Merged in feature/import (pull request #157)

Feature/import

* importstart

* pp

* tests

* importtests

* 100GB

* lint

* passtests

* utc

* awsprofile

* doublequotes

* host
This commit is contained in:
Michael McGuinness
2025-05-27 15:28:46 +00:00
parent 46882da5f5
commit cc2278086f
74 changed files with 992 additions and 4753 deletions
+23
View File
@@ -44,3 +44,26 @@ SELECT id FROM documents WHERE hash = $1 and clientId = $2;
-- name: ListDocumentIDsBatch :many
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);
-- name: GetDocumentUploadCurrentPart :one
WITH client as (
select clientId from clients where clientId = @clientId
),
parts as (
SELECT docs.part
FROM client as c
JOIN documentUploads as docs on docs.clientId = c.clientId
WHERE date(docs.createdAt) = date(@queryDate)
),
max_part as (
SELECT COALESCE(max(part), 0) as max_part_num FROM parts
)
SELECT
COALESCE(p.part, 0)::unsignedsmallint as part,
COUNT(p.part) as count
FROM parts p
RIGHT JOIN max_part mp ON p.part = mp.max_part_num
GROUP BY p.part;