3d434eedb8
Job Status Get and DB tidy up * initalquery * tests * shorttests * testing queries * job * solvedthequery * updatingdb * fixingtests * repotests * shorttests * docker * testspassed
79 lines
1.9 KiB
Go
79 lines
1.9 KiB
Go
// Code generated by sqlc. DO NOT EDIT.
|
|
// versions:
|
|
// sqlc v1.27.0
|
|
// source: clean.sql
|
|
|
|
package repository
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/jackc/pgx/v5/pgtype"
|
|
)
|
|
|
|
const addDocumentCleanEntry = `-- name: AddDocumentCleanEntry :exec
|
|
INSERT INTO documentCleans (documentId, version, bucket, key) VALUES ($1, $2, $3, $4)
|
|
`
|
|
|
|
type AddDocumentCleanEntryParams struct {
|
|
Documentid pgtype.UUID `db:"documentid"`
|
|
Version int32 `db:"version"`
|
|
Bucket string `db:"bucket"`
|
|
Key string `db:"key"`
|
|
}
|
|
|
|
// AddDocumentCleanEntry
|
|
//
|
|
// INSERT INTO documentCleans (documentId, version, bucket, key) VALUES ($1, $2, $3, $4)
|
|
func (q *Queries) AddDocumentCleanEntry(ctx context.Context, arg *AddDocumentCleanEntryParams) error {
|
|
_, err := q.db.Exec(ctx, addDocumentCleanEntry,
|
|
arg.Documentid,
|
|
arg.Version,
|
|
arg.Bucket,
|
|
arg.Key,
|
|
)
|
|
return err
|
|
}
|
|
|
|
const getDocumentCleanEntry = `-- name: GetDocumentCleanEntry :one
|
|
SELECT id, documentId, bucket, key, version
|
|
FROM currentCleanEntries
|
|
WHERE documentId = $1
|
|
`
|
|
|
|
// GetDocumentCleanEntry
|
|
//
|
|
// SELECT id, documentId, bucket, key, version
|
|
// FROM currentCleanEntries
|
|
// WHERE documentId = $1
|
|
func (q *Queries) GetDocumentCleanEntry(ctx context.Context, documentid pgtype.UUID) (*Currentcleanentry, error) {
|
|
row := q.db.QueryRow(ctx, getDocumentCleanEntry, documentid)
|
|
var i Currentcleanentry
|
|
err := row.Scan(
|
|
&i.ID,
|
|
&i.Documentid,
|
|
&i.Bucket,
|
|
&i.Key,
|
|
&i.Version,
|
|
)
|
|
return &i, err
|
|
}
|
|
|
|
const isDocumentClean = `-- name: IsDocumentClean :one
|
|
SELECT EXISTS(
|
|
SELECT 1 FROM currentCleanEntries WHERE documentId = $1
|
|
)
|
|
`
|
|
|
|
// IsDocumentClean
|
|
//
|
|
// SELECT EXISTS(
|
|
// SELECT 1 FROM currentCleanEntries WHERE documentId = $1
|
|
// )
|
|
func (q *Queries) IsDocumentClean(ctx context.Context, documentid pgtype.UUID) (bool, error) {
|
|
row := q.db.QueryRow(ctx, isDocumentClean, documentid)
|
|
var exists bool
|
|
err := row.Scan(&exists)
|
|
return exists, err
|
|
}
|