-- name: CreateSite :one
INSERT INTO sites (user_id, domain)
VALUES (?, ?)
RETURNING *;

-- name: GetSiteByID :one
SELECT * FROM sites
WHERE id = ?;

-- name: GetSitesByUserID :many
SELECT * FROM sites
WHERE user_id = ?
ORDER BY created_at DESC;

-- name: GetSiteByDomain :one
SELECT * FROM sites
WHERE domain = ?;

-- THIS IS NOT USED YET
-- -- name: UpdateSiteDomain :one
-- UPDATE sites
-- SET domain = ?
-- WHERE id = ?
-- RETURNING *;

-- name: DeleteSite :exec
DELETE FROM sites
WHERE id = ?;
