// Code generated by sqlc. DO NOT EDIT.
// versions:
//   sqlc v1.31.1
// source: chunks.sql

package codeindexsqlc

import (
	"context"

	"github.com/jackc/pgx/v5/pgtype"
)

const countChunksByRun = `-- name: CountChunksByRun :one
SELECT count(*) FROM code_chunks WHERE run_id = $1
`

func (q *Queries) CountChunksByRun(ctx context.Context, runID pgtype.UUID) (int64, error) {
	row := q.db.QueryRow(ctx, countChunksByRun, runID)
	var count int64
	err := row.Scan(&count)
	return count, err
}

const deleteChunksByRun = `-- name: DeleteChunksByRun :exec

DELETE FROM code_chunks WHERE run_id = $1
`

// The embedding (vector) column is intentionally excluded from every sqlc query
// here: sqlc has no native pgvector type. Vector INSERT (bulk) and cosine-KNN
// SELECT are hand-written in repository.go using the pgvector text literal format.
func (q *Queries) DeleteChunksByRun(ctx context.Context, runID pgtype.UUID) error {
	_, err := q.db.Exec(ctx, deleteChunksByRun, runID)
	return err
}
