Syntax
Reference for Core and Infra blocks (stable in v0.1). Full grammar: Specification. CRM example: crm-reference.aip. Security and Behavior blocks: Security, Workflows.Conventions
- Fields are declared inside
entity(name: type modifiers). - Modifier order:
required|optional→unique→default(value). - Identifiers:
PascalCasefor entities/events;snake_casefor fields.
app
| Member | Initial values |
|---|---|
database | postgres, mysql |
auth | jwt, session, api_key, oauth |
auth on app is the default; api { } may override HTTP exposure details.
entity
Types
relation
| Relation (inline, v0.1) | Usage |
|---|---|
belongs_to | FK to another entity |
has_one | 1:1 inverse (roadmap) |
has_many | 1:N (roadmap) |
many_to_many | N:N (roadmap) |
optional marks nullable / optional FK.
crud
Validation
Prefer inline modifiers:validation block (equivalent, for many rules):
index
unique on a field already creates a constraint; use index for non-unique or composite lookups.
api
app.auth unless overridden. Rate limit and CORS: Security.
Summary (Core + Infra)
| Block | Level | Function |
|---|---|---|
app | Core | Application defaults |
entity | Core | Data model |
inline enum(…) | Core | Enum field types |
inline belongs_to | Core | Relationships (v0.1) |
crud | Core | REST operations |
inline / validation | Core | Field rules |
index | Infra | Database indexes |
api | Infra | HTTP config |
seed | Infra | Seed data — Database |
