naise_pos/db/query/suppliers.sql
2023-03-05 23:35:41 +07:00

23 lines
377 B
SQL

-- name: CreateSuppliers :one
INSERT INTO suppliers (
merchant_id,
name,
detail
) VALUES (
$1, $2, $3
)
RETURNING *;
-- name: SuppliersList :many
SELECT * FROM suppliers
WHERE merchant_id = $1
ORDER BY index_id
LIMIT $2
OFFSET $3;
-- name: UpdateSupplier :one
SELECT * FROM suppliers
WHERE id = $1;
-- name: DeleteSupplier :exec
DELETE FROM suppliers where id = $1;