mirror of
https://codeberg.org/shroff/phylum.git
synced 2026-01-04 02:31:14 -06:00
21 lines
452 B
SQL
21 lines
452 B
SQL
-- name: SiloById :one
|
|
SELECT * from silos where id = $1;
|
|
|
|
-- name: SiloByName :one
|
|
SELECT * from silos where name = $1;
|
|
|
|
-- name: DeleteSilo :exec
|
|
DELETE from silos where id = $1;
|
|
|
|
-- name: CreateSilo :exec
|
|
INSERT INTO silos(
|
|
id, created, modified, owner, name, storage
|
|
) VALUES(
|
|
$1, NOW(), NOW(), $2, $3, $4
|
|
);
|
|
|
|
-- name: ListAllSilos :many
|
|
SELECT * from silos;
|
|
|
|
-- name: ListSilosForUser :many
|
|
SELECT * from silos where owner = @user_id::int; |