2024-12-19 18:49:22 +00:00
|
|
|
// Code generated by sqlc. DO NOT EDIT.
|
|
|
|
|
// versions:
|
|
|
|
|
// sqlc v1.27.0
|
|
|
|
|
// source: result.sql
|
|
|
|
|
|
|
|
|
|
package repository
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"context"
|
|
|
|
|
|
|
|
|
|
"github.com/jackc/pgx/v5/pgtype"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
const listResultsByDocumentID = `-- name: ListResultsByDocumentID :many
|
2024-12-19 19:49:40 +00:00
|
|
|
SELECT id, queryId, cleanVersion, textVersion, queryVersion FROM results where documentId = $1 and cleanVersion >= $2 and textVersion >= $3
|
2024-12-19 18:49:22 +00:00
|
|
|
`
|
|
|
|
|
|
2024-12-19 19:49:40 +00:00
|
|
|
type ListResultsByDocumentIDParams struct {
|
|
|
|
|
Documentid pgtype.UUID
|
|
|
|
|
Cleanversion int32
|
|
|
|
|
Textversion int32
|
|
|
|
|
}
|
|
|
|
|
|
2024-12-19 18:49:22 +00:00
|
|
|
type ListResultsByDocumentIDRow struct {
|
|
|
|
|
ID pgtype.UUID
|
|
|
|
|
Queryid pgtype.UUID
|
|
|
|
|
Cleanversion int32
|
|
|
|
|
Textversion int32
|
|
|
|
|
Queryversion int32
|
|
|
|
|
}
|
|
|
|
|
|
2024-12-19 19:49:40 +00:00
|
|
|
func (q *Queries) ListResultsByDocumentID(ctx context.Context, arg ListResultsByDocumentIDParams) ([]ListResultsByDocumentIDRow, error) {
|
|
|
|
|
rows, err := q.db.Query(ctx, listResultsByDocumentID, arg.Documentid, arg.Cleanversion, arg.Textversion)
|
2024-12-19 18:49:22 +00:00
|
|
|
if err != nil {
|
|
|
|
|
return nil, err
|
|
|
|
|
}
|
|
|
|
|
defer rows.Close()
|
|
|
|
|
var items []ListResultsByDocumentIDRow
|
|
|
|
|
for rows.Next() {
|
|
|
|
|
var i ListResultsByDocumentIDRow
|
|
|
|
|
if err := rows.Scan(
|
|
|
|
|
&i.ID,
|
|
|
|
|
&i.Queryid,
|
|
|
|
|
&i.Cleanversion,
|
|
|
|
|
&i.Textversion,
|
|
|
|
|
&i.Queryversion,
|
|
|
|
|
); err != nil {
|
|
|
|
|
return nil, err
|
|
|
|
|
}
|
|
|
|
|
items = append(items, i)
|
|
|
|
|
}
|
|
|
|
|
if err := rows.Err(); err != nil {
|
|
|
|
|
return nil, err
|
|
|
|
|
}
|
|
|
|
|
return items, nil
|
|
|
|
|
}
|