This commit is contained in:
2026-06-22 08:55:57 +08:00
parent dbb87823e8
commit 6ade6e8fa9
325 changed files with 41131 additions and 855 deletions
+36
View File
@@ -0,0 +1,36 @@
// 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
}