53ea7d34e6
Start adding Textract + UUID changes * base * startclient * ts * short * tests
21 lines
736 B
SQL
21 lines
736 B
SQL
-- name: IsDocumentTextExtracted :one
|
|
SELECT EXISTS(
|
|
SELECT 1 FROM currentTextEntries WHERE documentId = @documentId
|
|
);
|
|
|
|
-- name: GetDocumentTextExtractionByHash :one
|
|
SELECT id, documentId, bucket, key, version, hash, cleanEntryId
|
|
FROM currentTextEntries
|
|
WHERE cleanEntryId = @cleanEntryId and hash = @hash;
|
|
|
|
-- name: AddDocumentText :one
|
|
INSERT INTO documentTextExtractions (bucket, key, cleanEntryId, hash) VALUES ($1, $2, $3, $4) returning id;
|
|
|
|
-- name: AddDocumentTextEntry :exec
|
|
INSERT INTO documentTextExtractionEntries (textId, version) VALUES ($1, $2);
|
|
|
|
-- name: GetTextEntryByDocId :one
|
|
SELECT id, documentId, bucket, key, version, hash, cleanEntryId
|
|
FROM currentTextEntries
|
|
WHERE documentId = @documentId;
|