51 lines
1.1 KiB
Go
51 lines
1.1 KiB
Go
|
|
// 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
|
||
|
|
SELECT id, queryId, cleanVersion, textVersion, queryVersion FROM results where documentId = $1
|
||
|
|
`
|
||
|
|
|
||
|
|
type ListResultsByDocumentIDRow struct {
|
||
|
|
ID pgtype.UUID
|
||
|
|
Queryid pgtype.UUID
|
||
|
|
Cleanversion int32
|
||
|
|
Textversion int32
|
||
|
|
Queryversion int32
|
||
|
|
}
|
||
|
|
|
||
|
|
func (q *Queries) ListResultsByDocumentID(ctx context.Context, documentid pgtype.UUID) ([]ListResultsByDocumentIDRow, error) {
|
||
|
|
rows, err := q.db.Query(ctx, listResultsByDocumentID, documentid)
|
||
|
|
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
|
||
|
|
}
|