-- name: CreateOrg :one
INSERT INTO orgs (id, slug, name)
VALUES ($1, $2, $3)
RETURNING *;

-- name: GetOrgByID :one
SELECT * FROM orgs WHERE id = $1;

-- name: GetOrgBySlug :one
SELECT * FROM orgs WHERE slug = $1;

-- name: UpdateOrgName :one
UPDATE orgs SET name = $2 WHERE id = $1 RETURNING *;

-- name: ListOrgs :many
SELECT * FROM orgs ORDER BY id DESC LIMIT $1 OFFSET $2;
