- sqlc.yaml + internal/db/queries/*.sql: typed queries for entities, relationships, ontology, operations (signals, events, audit, idempotency, entity_status) - internal/db/sqlcgen/: generated Go from sqlc (pgx/v5) - internal/observability/record.go: Audit() and Event() helpers that write in the caller's transaction (SG10). actorLabel is interim text identity in detail JSON until OIDC resolution lands; actor_id column exists but is not yet populated - migrations/008: post-commit pg_notify trigger on events table for SSE fan-out (SG8/SG10)
14 lines
373 B
SQL
14 lines
373 B
SQL
-- name: ListEntityTypes :many
|
|
SELECT * FROM entity_types ORDER BY name;
|
|
|
|
-- name: ListRelationshipTypes :many
|
|
SELECT * FROM relationship_types ORDER BY name;
|
|
|
|
-- name: ListLifecycleDefs :many
|
|
SELECT * FROM lifecycle_defs ORDER BY id;
|
|
|
|
-- name: GetLifecycleForType :one
|
|
SELECT ld.* FROM lifecycle_defs ld
|
|
JOIN entity_types et ON et.lifecycle_id = ld.id
|
|
WHERE et.name = $1;
|