collectscollector
This commit is contained in:
@@ -12,9 +12,15 @@ import (
|
||||
)
|
||||
|
||||
const listResultsByDocumentID = `-- name: ListResultsByDocumentID :many
|
||||
SELECT id, queryId, cleanVersion, textVersion, queryVersion FROM results where documentId = $1
|
||||
SELECT id, queryId, cleanVersion, textVersion, queryVersion FROM results where documentId = $1 and cleanVersion >= $2 and textVersion >= $3
|
||||
`
|
||||
|
||||
type ListResultsByDocumentIDParams struct {
|
||||
Documentid pgtype.UUID
|
||||
Cleanversion int32
|
||||
Textversion int32
|
||||
}
|
||||
|
||||
type ListResultsByDocumentIDRow struct {
|
||||
ID pgtype.UUID
|
||||
Queryid pgtype.UUID
|
||||
@@ -23,8 +29,8 @@ type ListResultsByDocumentIDRow struct {
|
||||
Queryversion int32
|
||||
}
|
||||
|
||||
func (q *Queries) ListResultsByDocumentID(ctx context.Context, documentid pgtype.UUID) ([]ListResultsByDocumentIDRow, error) {
|
||||
rows, err := q.db.Query(ctx, listResultsByDocumentID, documentid)
|
||||
func (q *Queries) ListResultsByDocumentID(ctx context.Context, arg ListResultsByDocumentIDParams) ([]ListResultsByDocumentIDRow, error) {
|
||||
rows, err := q.db.Query(ctx, listResultsByDocumentID, arg.Documentid, arg.Cleanversion, arg.Textversion)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user