Skip to content

v0.10.0

Latest

Choose a tag to compare

@quinnjr quinnjr released this 27 May 13:34
· 2 commits to main since this release

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-engine Supports* 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 both create! and update!/upsert!.
  • Aggregate macros (#114, #115) β€” aggregate!, group_by!, and count! with select:; per-column counts, COUNT(DISTINCT), and group_by order_by.

Schema & engine

  • Multi-file schemas + Prisma directory import (#100) β€” point [schema].path at a directory; recursive load/merge with cross-file collision detection; prax import --from prisma mirrors prismaSchemaFolder layouts.
  • Computed and virtual fields (#111) β€” @generated("expr") @stored|@virtual DB-side columns with per-dialect DDL, and @count/@sum/@avg/@min/@max relation-aggregate virtuals via scalar-subquery lowering.
  • Single-statement upsert (#112, #113) β€” NestedWriteOp::Upsert emits one statement on Postgres/SQLite/DuckDB/MySQL (MSSQL/CQL keep the two-statement fallback).

Fixes

  • Filter::to_sql bind-placeholder numbering (#118) β€” leaf arms over-counted (param_idx += params.len()), producing out-of-range placeholders like IN ($1, $3, $6) that failed on positional dialects; a related nested And/Or double-count was also fixed. Regression tests cover nested groups, NotIn/Or/LIKE, offsets, and SQLite/MySQL.
  • Postgres String↔non-TEXT columns (#119) β€” FilterValue::String now binds/reads correctly against UUID, temporal (TIMESTAMPTZ/TIMESTAMP/DATE/TIME), and user-defined ENUM columns (previously WrongType); Option<T> is_null works on any column type.
  • prax_schema! with relations (#116, #117) β€” schema-path relation codegen now compiles: qualified relation paths, boxed single relations, per-model ModelRelationLoader, self-relation diagnostics.

Full detail in CHANGELOG.md.