DESCRIBE
DESCRIBE lists any concept registered in the DeReg and returns its definition — including DDL, field types, relationships, and metadata.
DESCRIBE is a structural introspection command: it shows how a concept is defined, not how it behaves at runtime.
Purpose
Section titled “Purpose”In an interactive DeQL session, you often need quick answers to questions like:
- What fields does this command expect?
- What aggregate does this decision target?
- What is the
STATE ASquery inside a decision? - What events does this projection consume?
DESCRIBE provides these answers directly in the SQL console, without evaluating decisions, replaying events, or executing projections.
Syntax
Section titled “Syntax”DESCRIBE <ConceptType> <Name>;Where <ConceptType> is one of: AGGREGATE, COMMAND, EVENT, DECISION, PROJECTION, EVENTSTORE, TEMPLATE.
Examples
Section titled “Examples”Describe an Aggregate
Section titled “Describe an Aggregate”deql> DESCRIBE AGGREGATE BankAccount;
Aggregate: BankAccount Events: AccountOpened, Deposited Decisions: Open, DepositFunds Projection: AccountBalanceDescribe a Command
Section titled “Describe a Command”deql> DESCRIBE COMMAND OpenAccount;
Command: OpenAccount Fields: account_id UUID initial_balance DECIMAL(12,2) Decision: Open Aggregate: BankAccountDescribe an Event
Section titled “Describe an Event”deql> DESCRIBE EVENT AccountOpened;
Event: AccountOpened Fields: initial_balance DECIMAL(12,2) Emitted by: Open (decision) Aggregate: BankAccountDescribe a Decision
Section titled “Describe a Decision”deql> DESCRIBE DECISION DepositFunds;
Decision: DepositFunds Aggregate: BankAccount Command: Deposit State: SELECT initial_balance AS balance FROM DeReg."BankAccount$Agg" WHERE aggregate_id = :account_id Emit: SELECT EVENT Deposited ( amount := :amount ) WHERE balance >= :amount Guard: balance >= :amountDescribe a Projection
Section titled “Describe a Projection”deql> DESCRIBE PROJECTION AccountBalance;
Projection: AccountBalance Source: DeReg."BankAccount$Events" Fields: aggregate_id UUID balance DECIMAL(12,2) Query: SELECT stream_id AS aggregate_id, LAST(data.initial_balance) AS balance FROM DeReg."BankAccount$Events" GROUP BY stream_idDescribe an EventStore
Section titled “Describe an EventStore”deql> DESCRIBE EVENTSTORE local_dev;
EventStore: local_dev Durable: parquet (/tmp/deql/) Immutable: trueDescribe a Template
Section titled “Describe a Template”deql> DESCRIBE TEMPLATE wallet_aggregate;
Template: wallet_aggregate Parameters: wallet_name STRING currency STRING Produces: AGGREGATE {{wallet_name}}Wallet COMMANDS TopUp{{wallet_name}}, Debit{{wallet_name}} EVENTS {{wallet_name}}WalletToppedUp, {{wallet_name}}WalletDebited DECISIONS TopUp{{wallet_name}}, Debit{{wallet_name}} PROJECTION {{wallet_name}}WalletBalance Instances: Main (wallet_name = 'Main', currency = 'USD') Promo (wallet_name = 'Promo', currency = 'USD')List All Concepts
Section titled “List All Concepts”Use DESCRIBE without a name to list all registered concepts of a type:
deql> DESCRIBE AGGREGATES;
Aggregate | Decisions | Events | Projection ----------------|-----------|--------|------------------- Employee | 2 | 2 | EmployeeRoster BankAccount | 2 | 2 | AccountBalance
deql> DESCRIBE COMMANDS;
Command | Aggregate | Decision ---------------------|-----------------|------------------ HireEmployee | Employee | Hire PromoteEmployee | Employee | Promote OpenAccount | BankAccount | Open Deposit | BankAccount | DepositFunds
deql> DESCRIBE DECISIONS;
Decision | Aggregate | Command | Guard ---------------------|-----------------|------------------|------------------ Hire | Employee | HireEmployee | (none) Promote | Employee | PromoteEmployee | (none) Open | BankAccount | OpenAccount | (none) DepositFunds | BankAccount | Deposit | balance >= :amountVALIDATE DEREG
Section titled “VALIDATE DEREG”Cross-reference all registered concepts for consistency. This checks that every command has a matching decision, every event is emitted by at least one decision, and all aggregate references resolve:
VALIDATE DEREG;EXPORT DEREG
Section titled “EXPORT DEREG”Dump the entire Decision Registry as reproducible DeQL statements. Useful for backup, migration, or sharing a complete system definition:
EXPORT DEREG;Meta Tables (Optional)
Section titled “Meta Tables (Optional)”For programmatic access, the DeReg metadata can optionally be exposed as queryable tables:
SELECT * FROM DeReg.meta_aggregates;SELECT * FROM DeReg.meta_commands;SELECT * FROM DeReg.meta_events;SELECT * FROM DeReg.meta_decisions;SELECT * FROM DeReg.meta_projections;SELECT * FROM DeReg.meta_eventstores;SELECT * FROM DeReg.meta_templates;These are read-only tables populated from the DeReg on startup. They support standard SQL — filtering, joining, exporting:
-- Find all decisions that read from more than one aggregateSELECT name, aggregate, state_queryFROM DeReg.meta_decisionsWHERE state_query LIKE '%JOIN%';
-- Find all events not consumed by any projectionSELECT e.nameFROM DeReg.meta_events eLEFT JOIN DeReg.meta_projections p ON p.event_types LIKE '%' || e.name || '%'WHERE p.name IS NULL;DeQL Keyword Summary
Section titled “DeQL Keyword Summary”With DESCRIBE, VALIDATE DEREG, and EXPORT DEREG, the complete set of DeQL keywords is:
| Keyword | Purpose |
|---|---|
CREATE | Define aggregates, commands, events, decisions, projections, eventstores, templates |
CREATE OR REPLACE | Overwrite existing definitions for aggregates, commands, events |
APPLY / USE | Instantiate a template |
EXECUTE | Send a command, trigger a decision, get events back |
INSPECT | Simulate decisions or projections side-effect-free |
DESCRIBE | Inspect any concept’s definition and metadata |
VALIDATE DEREG | Cross-reference consistency check across all registered concepts |
EXPORT DEREG | Dump the Decision Registry as reproducible DeQL |
SELECT | Query projections, event streams, aggregate state, meta tables |