short/sql/query.sql

10 lines
181 B
MySQL
Raw Normal View History

2024-01-29 18:32:01 +00:00
-- name: GetURLByHash :one
SELECT * FROM urls
WHERE hash = $1;
2024-01-29 20:21:23 +00:00
-- name: InsertURL :one
INSERT INTO urls (hash, long_url)
VALUES ($1, $2)
ON CONFLICT (hash) DO NOTHING
RETURNING *;