display folders

This commit is contained in:
m
2026-07-13 16:54:12 +02:00
parent c8f5935469
commit 07b03562b1
10 changed files with 78 additions and 15 deletions
+8 -3
View File
@@ -9,7 +9,7 @@ ORDER BY created_at DESC;
-- name: ListFolders :many
SELECT * FROM files
WHERE parent_file_id IS NOT NULL
WHERE is_folder = true
ORDER BY created_at DESC;
-- name: ListFilesByID :many
@@ -23,10 +23,15 @@ VALUES ($1, $2, $3, $4, $5, $6, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP)
RETURNING *;
-- name: CreateFolder :one
INSERT INTO files (id, name, created_at, updated_at)
VALUES ($1, $2, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP)
INSERT INTO files (id, name, is_folder, created_at, updated_at)
VALUES ($1, $2, true, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP)
RETURNING *;
-- name: ListFilesByParentID :many
SELECT * FROM files
WHERE parent_file_id = $1
ORDER BY is_folder DESC, created_at DESC;
-- name: UpdateFile :exec
UPDATE files
SET name = $1, mime_type = $2, ocr_text = $3, updated_at = CURRENT_TIMESTAMP