-- name: GetPrinciple :one
SELECT * FROM principles
WHERE id = ? LIMIT 1;

-- name: ListPrinciples :many
SELECT * FROM principles
ORDER BY name
LIMIT ? OFFSET ?;

-- name: CreatePrinciple :execresult
INSERT INTO principles (name, short_name, code) VALUES (?, ?, ?);

-- name: UpdatePrinciple :exec
UPDATE principles SET name = ?, short_name = ?, code = ? WHERE id = ?;

-- name: GetPrincipleProducts :many
SELECT * FROM products
WHERE principle_id = ?
ORDER BY title;