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

23 lines
377 B
SQL

-- name: CreateCustomers :one
INSERT INTO customers (
merchant_id,
name,
detail
) VALUES (
$1, $2, $3
)
RETURNING *;
-- name: CustomersList :many
SELECT * FROM customers
WHERE merchant_id = $1
ORDER BY index_id
LIMIT $2
OFFSET $3;
-- name: UpdateCustomer :one
SELECT * FROM customers
WHERE id = $1;
-- name: DeleteCustomer :exec
DELETE FROM customers where id = $1;