orm_table!Typed structure
Tables, columns, values, assignments, and result shapes agree at compile time.
Compose with Rust types, compile parameterized SQL, then run it on async SQLite or PostgreSQL.
update_table::<Job>()
.set(Job::state(), "leased")
.filter(Job::id().eq(42))
.returning(Job::id())update "jobs"
set "state" = $1
where "jobs"."id" = $2
returning "jobs"."id"[String("leased"), I64(42)]SQLite is enabled by default. Select PostgreSQL or use the compiler alone.
a3s-orm = { git = "https://github.com/A3S-Lab/ORM", tag = "v0.2.0" }Each layer owns one stable contract, from table declarations through decoded results.
orm_table!Tables, columns, values, assignments, and result shapes agree at compile time.
QueryJoins, CTEs, windows, set operations, and locks remain structured nodes.
ExecutorCompilers emit SQL and parameters. Async drivers own connections and rows.
MigratorOrdered versions, SHA-256 checksums, and database locks protect history.
No implicit persistence behavior. No runtime value enters SQL text.
Rust types define legal composition
Semantics and parameter boundaries stay intact
Owns quoting, placeholders, and capability checks
Owns connections, transactions, and decoding
A Tokio-safe single connection with WAL, foreign keys, and cancellation-safe transactions.
A bounded pool with prepared statements, rustls, health snapshots, and explicit retry classes.
Declare a table, compile its SQL, then connect the async runtime you need.