You've already forked gun-manager-backend
commit
This commit is contained in:
21
sql/query.sql
Normal file
21
sql/query.sql
Normal file
@@ -0,0 +1,21 @@
|
||||
-- name: GetGunById :one
|
||||
SELECT guns.id as id, make, model, serial_number, purchase_amount, value_amount, date_purchased, notes
|
||||
from guns
|
||||
where guns.id = ?;
|
||||
|
||||
-- name: GetGunPhotos :many
|
||||
SELECT id, filename from photos where gun_id = ?;
|
||||
|
||||
-- name: GetGunPhotoData :one
|
||||
select photo from photos where id = ?;
|
||||
|
||||
-- name: GetAllGuns :many
|
||||
SELECT id, make, model, value_amount
|
||||
from guns
|
||||
order by id desc;
|
||||
|
||||
-- name: InsertGun :one
|
||||
INSERT into guns
|
||||
(make, model, serial_number, purchase_amount, value_amount, date_purchased, notes) VALUES
|
||||
(?, ?, ?, ?, ?, ?, ?) returning id
|
||||
|
||||
Reference in New Issue
Block a user