Skip to content

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

TypeNotes
IdULID assigned on insert when omitted
Text / Int / Float / BoolScalars
Money / Money<usd>Minor units + currency — Types
Time / DurationWall time; duration literals like 7d
Bytes / JsonOpaque / nested; Json field access yields unknown
enum { a, b }Variants written as .a in queries
ref OtherAdvisory relationship for joinnot a storage FK
unknownDrift / untyped surface

Defaults: region: Text = "us". Strictness annotations: @strict / @loose (default loose).

Indexes

eel
email: Text @index

Equality 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

  • @vN bumps 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.

Pre-alpha. Local-first. Stdlib-only Rust engine. Tenant concerns shifted left into the database.