0.10.0 is a large feature release: the schema-aware macro DSL lands end-to-end (phases 1β6), alongside multi-file schemas, computed/virtual fields, and a batch of correctness fixes. 22 PRs since 0.9.7.
Highlights
Schema-aware macro DSL (phases 1β6)
- Typed input codegen + capability gates (#99, #101) β per-model
WhereInput/WhereUniqueInput/Include/Select/OrderBy/CreateInput/UpdateInput, with per-engineSupports*capability markers (CQL engines gated at compile time). - Read-operation macros (#102) β
find_unique!,find_first!,find_many!,count!,delete!,delete_many!with a Prisma-style brace DSL: nested filters,and/or/not, relation operators,..spread,#[if]/#[else], bare-ident enums, did-you-mean diagnostics. - Shape macros (#103) β
r#where!,include!,select!,order_by!,cursor!return reusable typed input values. - Flat write macros (#104) β
create!,update!,upsert!,create_many!,update_many!with atomic update operators. - Nested writes (#105β#110) β full Prisma operator set inside
data:(create,connect,disconnect,delete,delete_many,update,update_many,upsert,connect_or_create,set), in bothcreate!andupdate!/upsert!. - Aggregate macros (#114, #115) β
aggregate!,group_by!, andcount!withselect:; per-column counts,COUNT(DISTINCT), andgroup_byorder_by.
Schema & engine
- Multi-file schemas + Prisma directory import (#100) β point
[schema].pathat a directory; recursive load/merge with cross-file collision detection;prax import --from prismamirrorsprismaSchemaFolderlayouts. - Computed and virtual fields (#111) β
@generated("expr") @stored|@virtualDB-side columns with per-dialect DDL, and@count/@sum/@avg/@min/@maxrelation-aggregate virtuals via scalar-subquery lowering. - Single-statement upsert (#112, #113) β
NestedWriteOp::Upsertemits one statement on Postgres/SQLite/DuckDB/MySQL (MSSQL/CQL keep the two-statement fallback).
Fixes
Filter::to_sqlbind-placeholder numbering (#118) β leaf arms over-counted (param_idx += params.len()), producing out-of-range placeholders likeIN ($1, $3, $6)that failed on positional dialects; a related nestedAnd/Ordouble-count was also fixed. Regression tests cover nested groups,NotIn/Or/LIKE, offsets, and SQLite/MySQL.- Postgres
Stringβnon-TEXT columns (#119) βFilterValue::Stringnow binds/reads correctly againstUUID, temporal (TIMESTAMPTZ/TIMESTAMP/DATE/TIME), and user-definedENUMcolumns (previouslyWrongType);Option<T>is_nullworks on any column type. prax_schema!with relations (#116, #117) β schema-path relation codegen now compiles: qualified relation paths, boxed single relations, per-modelModelRelationLoader, self-relation diagnostics.
Full detail in CHANGELOG.md.