2025-02-07 12:12:51 +00:00
|
|
|
// 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
|
2025-02-28 13:11:53 +00:00
|
|
|
INSERT INTO documentCleans (documentId, version, bucket, key, mimetype, fail) VALUES ($1, $2, $3, $4, $5, $6)
|
2025-02-07 12:12:51 +00:00
|
|
|
`
|
|
|
|
|
|
|
|
|
|
type AddDocumentCleanEntryParams struct {
|
2025-02-28 13:11:53 +00:00
|
|
|
Documentid pgtype.UUID `db:"documentid"`
|
|
|
|
|
Version int32 `db:"version"`
|
|
|
|
|
Bucket *string `db:"bucket"`
|
|
|
|
|
Key *string `db:"key"`
|
|
|
|
|
Mimetype NullCleanmimetypes `db:"mimetype"`
|
|
|
|
|
Fail NullCleanfailtype `db:"fail"`
|
2025-02-07 12:12:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// AddDocumentCleanEntry
|
|
|
|
|
//
|
2025-02-28 13:11:53 +00:00
|
|
|
// INSERT INTO documentCleans (documentId, version, bucket, key, mimetype, fail) VALUES ($1, $2, $3, $4, $5, $6)
|
2025-02-07 12:12:51 +00:00
|
|
|
func (q *Queries) AddDocumentCleanEntry(ctx context.Context, arg *AddDocumentCleanEntryParams) error {
|
|
|
|
|
_, err := q.db.Exec(ctx, addDocumentCleanEntry,
|
|
|
|
|
arg.Documentid,
|
|
|
|
|
arg.Version,
|
|
|
|
|
arg.Bucket,
|
|
|
|
|
arg.Key,
|
2025-02-28 13:11:53 +00:00
|
|
|
arg.Mimetype,
|
|
|
|
|
arg.Fail,
|
2025-02-07 12:12:51 +00:00
|
|
|
)
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
|
2025-02-07 14:15:06 +00:00
|
|
|
const getDocumentCleanEntry = `-- name: GetDocumentCleanEntry :one
|
2025-02-28 13:11:53 +00:00
|
|
|
SELECT id, documentId, bucket, key, version, mimetype, fail
|
2025-02-20 19:02:44 +00:00
|
|
|
FROM currentCleanEntries
|
|
|
|
|
WHERE documentId = $1
|
2025-02-07 14:15:06 +00:00
|
|
|
`
|
|
|
|
|
|
|
|
|
|
// GetDocumentCleanEntry
|
|
|
|
|
//
|
2025-02-28 13:11:53 +00:00
|
|
|
// SELECT id, documentId, bucket, key, version, mimetype, fail
|
2025-02-20 19:02:44 +00:00
|
|
|
// FROM currentCleanEntries
|
|
|
|
|
// WHERE documentId = $1
|
|
|
|
|
func (q *Queries) GetDocumentCleanEntry(ctx context.Context, documentid pgtype.UUID) (*Currentcleanentry, error) {
|
2025-02-07 14:15:06 +00:00
|
|
|
row := q.db.QueryRow(ctx, getDocumentCleanEntry, documentid)
|
2025-02-20 19:02:44 +00:00
|
|
|
var i Currentcleanentry
|
2025-02-11 15:22:59 +00:00
|
|
|
err := row.Scan(
|
2025-02-20 19:02:44 +00:00
|
|
|
&i.ID,
|
2025-02-11 15:22:59 +00:00
|
|
|
&i.Documentid,
|
|
|
|
|
&i.Bucket,
|
|
|
|
|
&i.Key,
|
|
|
|
|
&i.Version,
|
2025-02-28 13:11:53 +00:00
|
|
|
&i.Mimetype,
|
|
|
|
|
&i.Fail,
|
2025-02-11 15:22:59 +00:00
|
|
|
)
|
2025-02-07 14:15:06 +00:00
|
|
|
return &i, err
|
|
|
|
|
}
|
|
|
|
|
|
2025-02-28 13:11:53 +00:00
|
|
|
const hasDocumentCleanEntry = `-- name: HasDocumentCleanEntry :one
|
2025-02-07 12:12:51 +00:00
|
|
|
SELECT EXISTS(
|
2025-02-20 19:02:44 +00:00
|
|
|
SELECT 1 FROM currentCleanEntries WHERE documentId = $1
|
2025-02-07 12:12:51 +00:00
|
|
|
)
|
|
|
|
|
`
|
|
|
|
|
|
2025-02-28 13:11:53 +00:00
|
|
|
// HasDocumentCleanEntry
|
2025-02-07 12:12:51 +00:00
|
|
|
//
|
|
|
|
|
// SELECT EXISTS(
|
2025-02-20 19:02:44 +00:00
|
|
|
// SELECT 1 FROM currentCleanEntries WHERE documentId = $1
|
2025-02-07 12:12:51 +00:00
|
|
|
// )
|
2025-02-28 13:11:53 +00:00
|
|
|
func (q *Queries) HasDocumentCleanEntry(ctx context.Context, documentid pgtype.UUID) (bool, error) {
|
|
|
|
|
row := q.db.QueryRow(ctx, hasDocumentCleanEntry, documentid)
|
2025-02-07 12:12:51 +00:00
|
|
|
var exists bool
|
|
|
|
|
err := row.Scan(&exists)
|
|
|
|
|
return exists, err
|
|
|
|
|
}
|