Schemas
Schemas are code — checked into the repo, versioned with @vN, and fingerprinted for lazy apply-on-touch.
eel
schema Users @v1 {
id: Id
name: Text
email: Text @index
active: Bool
balance: Money<usd>
status: enum { trial, paid, suspended }
}Demo: examples/demo_schema.eel. Storefront scene: examples/storefront.eel.
Field types
| Type | Notes |
|---|---|
Id | ULID assigned on insert when omitted |
Text / Int / Float / Bool | Scalars |
Money / Money<usd> | Minor units + currency — Types |
Time / Duration | Wall time; duration literals like 7d |
Bytes / Json | Opaque / nested; Json field access yields unknown |
enum { a, b } | Variants written as .a in queries |
ref Other | Advisory relationship for join — not a storage FK |
unknown | Drift / untyped surface |
Defaults: region: Text = "us". Strictness annotations: @strict / @loose (default loose).
Indexes
eel
email: Text @indexEquality lookups can use the secondary index. The planner (eelden-plan) emits an index-vs-scan hint; Studio shows it above the result grid. Range / multi-field indexes are not implemented yet.
Versions
@vNbumps the schema version; the engine fingerprints the IR.- On first touch after a deploy fingerprint changes, Slice A apply-on-touch runs (ensure indexes, clear
pending_migration).
Destructive changes use @breaking(from: @vN) plus a transform { drop … } block — see Migrations.
eel
schema Orders @v4 @breaking(from: @v3) {
id: Id
total: Money<usd>
} transform { drop region }Refs are advisory
listing: ref Listings lets the query layer and LSP treat join listing as typed nested shape. There is no cascade, no write-time check, no delete blocking. Consistency is the application's job.