bbd86fb4ea
Collector Build Version * lint * fixtests
80 lines
2.0 KiB
Go
80 lines
2.0 KiB
Go
// Code generated by sqlc. DO NOT EDIT.
|
|
// versions:
|
|
// sqlc v1.27.0
|
|
// source: text.sql
|
|
|
|
package repository
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/jackc/pgx/v5/pgtype"
|
|
)
|
|
|
|
const addDocumentTextEntry = `-- name: AddDocumentTextEntry :exec
|
|
INSERT INTO documentTextExtractions (version, bucket, key, cleanEntryId) VALUES ($1, $2, $3, $4)
|
|
`
|
|
|
|
type AddDocumentTextEntryParams struct {
|
|
Version int64 `db:"version"`
|
|
Bucket string `db:"bucket"`
|
|
Key string `db:"key"`
|
|
Cleanentryid pgtype.UUID `db:"cleanentryid"`
|
|
}
|
|
|
|
// AddDocumentTextEntry
|
|
//
|
|
// INSERT INTO documentTextExtractions (version, bucket, key, cleanEntryId) VALUES ($1, $2, $3, $4)
|
|
func (q *Queries) AddDocumentTextEntry(ctx context.Context, arg *AddDocumentTextEntryParams) error {
|
|
_, err := q.db.Exec(ctx, addDocumentTextEntry,
|
|
arg.Version,
|
|
arg.Bucket,
|
|
arg.Key,
|
|
arg.Cleanentryid,
|
|
)
|
|
return err
|
|
}
|
|
|
|
const getTextEntryByDocId = `-- name: GetTextEntryByDocId :one
|
|
SELECT id, documentId, bucket, key, version, cleanEntryId
|
|
FROM currentTextEntries
|
|
WHERE documentId = $1
|
|
`
|
|
|
|
// GetTextEntryByDocId
|
|
//
|
|
// SELECT id, documentId, bucket, key, version, cleanEntryId
|
|
// FROM currentTextEntries
|
|
// WHERE documentId = $1
|
|
func (q *Queries) GetTextEntryByDocId(ctx context.Context, documentid pgtype.UUID) (*Currenttextentry, error) {
|
|
row := q.db.QueryRow(ctx, getTextEntryByDocId, documentid)
|
|
var i Currenttextentry
|
|
err := row.Scan(
|
|
&i.ID,
|
|
&i.Documentid,
|
|
&i.Bucket,
|
|
&i.Key,
|
|
&i.Version,
|
|
&i.Cleanentryid,
|
|
)
|
|
return &i, err
|
|
}
|
|
|
|
const isDocumentTextExtracted = `-- name: IsDocumentTextExtracted :one
|
|
SELECT EXISTS(
|
|
SELECT 1 FROM currentTextEntries WHERE documentId = $1
|
|
)
|
|
`
|
|
|
|
// IsDocumentTextExtracted
|
|
//
|
|
// SELECT EXISTS(
|
|
// SELECT 1 FROM currentTextEntries WHERE documentId = $1
|
|
// )
|
|
func (q *Queries) IsDocumentTextExtracted(ctx context.Context, documentid pgtype.UUID) (bool, error) {
|
|
row := q.db.QueryRow(ctx, isDocumentTextExtracted, documentid)
|
|
var exists bool
|
|
err := row.Scan(&exists)
|
|
return exists, err
|
|
}
|