Never gonna let you down

This commit is contained in:
2023-08-07 20:38:50 -04:00
parent ca56ca7b29
commit 04ebe9e855
4 changed files with 166 additions and 8 deletions

View File

@@ -17,5 +17,16 @@ order by id desc;
-- name: InsertGun :one
INSERT into guns
(make, model, serial_number, purchase_amount, value_amount, date_purchased, notes) VALUES
(?, ?, ?, ?, ?, ?, ?) returning id
(?, ?, ?, ?, ?, ?, ?) returning id;
-- name: DeleteGun :exec
DELETE from guns where id = ?;
-- name: DeleteGunPhotosByGunId :exec
DELETE FROM photos where gun_id = ?;
-- name: DeleteGunPhotosById :exec
DELETE FROM photos where id = ?;
-- name: InsertGunPhoto :exec
INSERT into photos (gun_id, photo, filename) values (?, ?, ?);