Merged in feature/preserve-folder-paths (pull request #179)

support folder paths

* support folder paths

* s3 storage docs
This commit is contained in:
Jay Brown
2025-09-05 18:25:31 +00:00
parent 0ad41de26b
commit 730f3ba11a
27 changed files with 8281 additions and 63 deletions
+11 -2
View File
@@ -30,8 +30,11 @@ GROUP BY d.id, d.clientId, d.hash;
-- name: ListDocumentsByClient :many
SELECT id, hash from documents where clientId = @clientId;
-- name: ListDocumentsByBatch :many
SELECT id, hash, filename from documents where batch_id = @batch_id;
-- name: CreateDocument :one
INSERT INTO documents (clientId, hash, batch_id) VALUES ($1, $2, $3) RETURNING id;
INSERT INTO documents (clientId, hash, batch_id, filename) VALUES ($1, $2, $3, $4) RETURNING id;
-- name: AddDocumentEntry :exec
INSERT INTO documentEntries (documentId, bucket, key) VALUES ($1, $2, $3);
@@ -46,7 +49,13 @@ SELECT id FROM documents WHERE hash = $1 and clientId = $2;
SELECT id, totalCount FROM listDocumentIDs(@clientId, @batchSize, @pageOffset);
-- name: AddDocumentUpload :exec
INSERT INTO documentUploads (id, clientId, bucket, key, part, createdAt) VALUES ($1, $2, $3, $4, $5, $6);
INSERT INTO documentUploads (id, clientId, bucket, key, part, createdAt, filename, batch_id) VALUES ($1, $2, $3, $4, $5, $6, $7, $8);
-- name: GetDocumentUploadByKey :one
SELECT id, clientId, bucket, key, part, createdAt, filename, batch_id FROM documentUploads WHERE bucket = $1 AND key = $2 LIMIT 1;
-- name: ListDocumentUploads :many
SELECT id, clientId, bucket, key, part, createdAt, filename, batch_id FROM documentUploads WHERE clientId = $1 ORDER BY createdAt;
-- name: GetDocumentUploadCurrentPart :one
WITH client as (