-- name: CreateWorkspace :one
INSERT INTO organization.workspaces (org_id, name, slug)
VALUES ($1, $2, $3)
RETURNING *;

-- name: GetWorkspacesByOrgID :many
SELECT * FROM organization.workspaces
WHERE org_id = $1
ORDER BY name;

-- name: GetWorkspaceByID :one
SELECT * FROM organization.workspaces
WHERE workspace_id = $1;

-- name: CountWorkspacesByOrgID :one
SELECT COUNT(*) FROM organization.workspaces
WHERE org_id = $1;
