The database is IN the language. @table makes a class a table; insert writes a row; queries are first-class expressions; an UPDATE is a plain field assignment on a query result. With WO_DATA=<dir> every commit is WAL-durable before it is acknowledged and replays on restart — this very site stores these chapters that way, and the admin form's edits survive a kill.
@table(name: "notes", index: [tag])
class Note {
tag: Text @unique
val: Int
}
insert Note { tag: "first", val: 1 };
for n in from x in Note where x.val > 0 order by x.tag select x {
print("${n.tag} = ${n.val}");
}
let hits = from x in Note where x.tag == "first" take 1 select x;
if len(hits) == 1 {
hits[0].val = 2; -- an update: assign through the row
}