feat: add create short url
This commit is contained in:
parent
c7be765c23
commit
31fde6cad6
8 changed files with 149 additions and 20 deletions
|
@ -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 *;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue