No changes made

This commit is contained in:
2025-04-16 12:47:04 -04:00
commit 1ed3b0c2d4
98 changed files with 8857 additions and 0 deletions

View File

@@ -0,0 +1,63 @@
-- name: GetBullets :many
select bullets.id as id,
bullets.name as name,
weight,
diameter,
bullets.created_at,
meta,
m.id as manufacturer_id,
m.name as manufacturer_name,
m.url as manufacturer_url
from bullets
join manufacturers m on m.id = bullets.manufacturer_id
order by manufacturer_name, bullets.name desc;
-- name: GetBulletById :one
select bullets.id as id,
bullets.name,
bullets.diameter,
bullets.weight,
bullets.meta,
bullets.photo,
bullets.created_at,
m.id as manufactuerer_id,
m.name as manufacutuer_name,
m.url as manufacturer_url
from bullets
join manufacturers m on m.id = bullets.manufacturer_id
where bullets.id = $1;
-- name: ForPage :many
select bullets.id as id,
bullets.name as name,
weight,
diameter,
bullets.created_at,
meta,
m.id as manufacturer_id,
m.name as manufacturer_name,
m.url as manufacturer_url
from bullets
join manufacturers m on m.id = bullets.manufacturer_id
order by manufacturer_name, bullets.name desc
limit $1 offset $2;
-- name: DeleteBullet :exec
DELETE
from bullets
where id = $1;
-- name: AddBullet :one
insert into bullets (name, weight, diameter, photo, meta, manufacturer_id)
values ($1, $2, $3, $4, $5, $6)
returning id;
-- name: UpdateBullet :exec
UPDATE bullets
set name=$1,
weight=$2,
diameter=$3,
photo=$4,
meta=$5,
manufacturer_id=$6
where id = $7;