initiall commit

This commit is contained in:
Tomas Dvorak
2026-04-10 12:03:31 +02:00
commit 7ddfb1f52b
276 changed files with 37629 additions and 0 deletions
+40
View File
@@ -0,0 +1,40 @@
-- name: CreateBucket :one
INSERT INTO core.buckets (
project_id,
slug,
name,
visibility,
created_by_user_id
) VALUES ($1, $2, $3, $4, $5)
RETURNING *;
-- name: ListBucketsForProject :many
SELECT * FROM core.buckets
WHERE project_id = $1
AND (
btrim($2) = ''
OR slug ILIKE '%' || btrim($2) || '%'
OR name ILIKE '%' || btrim($2) || '%'
)
ORDER BY created_at ASC;
-- name: GetBucketByID :one
SELECT
b.*,
p.organization_id
FROM core.buckets b
JOIN core.projects p ON p.id = b.project_id
WHERE b.id = $1;
-- name: UpdateBucketByID :one
UPDATE core.buckets
SET slug = $2,
name = $3,
visibility = $4
WHERE id = $1
RETURNING *;
-- name: DeleteBucketByID :one
DELETE FROM core.buckets
WHERE id = $1
RETURNING *;