-- name: ListZones :many
SELECT * FROM zones ORDER BY name;

-- name: GetZone :one
SELECT * FROM zones WHERE id = ?;

-- name: CreateZone :one
INSERT INTO zones (zone_id, name, api_key)
VALUES (?, ?, ?)
RETURNING *;

-- name: UpdateZone :one
UPDATE zones
SET zone_id = ?, name = ?, api_key = ?, updated_at = CURRENT_TIMESTAMP
WHERE id = ?
RETURNING *;

-- name: DeleteZone :exec
DELETE FROM zones WHERE id = ?;
