90353d8161
Doc Clean Structure * outline * isdocclean * placeholder for clean log * versionplustesting * versionplustesting * testspassed
15 lines
515 B
SQL
15 lines
515 B
SQL
-- name: GetDocument :one
|
|
SELECT id, jobId, hash FROM documents WHERE id = $1 LIMIT 1;
|
|
|
|
-- name: CreateDocument :one
|
|
INSERT INTO documents (jobId, hash) VALUES ($1, $2) RETURNING id;
|
|
|
|
-- name: AddDocumentEntry :exec
|
|
INSERT INTO documentEntries (documentId, bucket, key) VALUES ($1, $2, $3);
|
|
|
|
-- name: GetDocumentEntry :one
|
|
SELECT documentId, bucket, key FROM documentEntries WHERE documentId = $1 ORDER BY id DESC LIMIT 1;
|
|
|
|
-- name: GetDocumentIDByHash :one
|
|
SELECT id FROM documents WHERE hash = $1 and jobId = $2;
|