feat: add create short url

This commit is contained in:
Bastien Riviere 2024-01-29 21:21:23 +01:00
parent c7be765c23
commit 31fde6cad6
Signed by: babariviere
GPG key ID: 4E5F0839249F162E
8 changed files with 149 additions and 20 deletions

View file

@ -1,3 +1,9 @@
-- name: GetURLByHash :one
SELECT * FROM urls
WHERE hash = $1;
-- name: InsertURL :one
INSERT INTO urls (hash, long_url)
VALUES ($1, $2)
ON CONFLICT (hash) DO NOTHING
RETURNING *;