[server] Prepare for publink by root and user

This commit is contained in:
Abhishek Shroff
2024-10-29 14:04:15 +05:30
parent 5b56f253cc
commit 7532643abf
9 changed files with 173 additions and 44 deletions

View File

@@ -9,7 +9,13 @@ INSERT INTO publinks(name, created_by, root, password_hash, expires, max_accesse
@name::text,
@created_by::text,
@root::uuid,
sqlc.narg('password_hash')::text,
@password_hash::text,
sqlc.narg('expires')::timestamp,
sqlc.narg('max_accesses')::int
);
@max_accesses::int
);
-- name: PublinksByRoot :many
SELECT * FROM publinks WHERE root = @root::uuid;
-- name: PublinksByCreator :many
SELECT * FROM publinks WHERE created_by = @username::text;