ruprizzle is a schema-first ORM for Rust that takes Prisma's declarative schema, generated typed client and automatic migration diffing, and pairs them with Drizzle's SQL transparency — no hidden query engine, no sidecar binary, and `.to_sql()` available on every builder so you always know what is being sent to the database. Postgres and SQLite are supported from day one behind a `DbDialect` trait, and the wire protocol and pooling come from sqlx rather than a driver of our own. It is an honest beta: the core is complete, the API is stabilising, and the boundaries are written down.
The tools that make ruprizzle work the way you do — no add-ons, no surprises.
Models, migrations and the typed client are all derived from a single declarative `schema.ruprizzle` file. You never hand-edit generated code, and the schema cannot drift away from the database.
Column tokens are typed `Column<Model, T>`, so a wrong-typed filter or a filter from the wrong model fails to compile instead of failing in production.
No sidecar binary, no WASM engine, no hidden thread pool. The generated client is plain Rust calling sqlx, and `.to_sql()` on every builder shows you exactly what will be sent.
`migrate dev` diffs your schema against the last snapshot and writes `up.sql`/`down.sql` across 12 change classes. `migrate deploy` never diffs, so a prototyping command cannot slip into CI.
Prisma-style `.include()` with per-relation filters, ordering and limits. A two-level include issues at most one query per level — the bound is asserted in the test suite, not just claimed.
`init`, `generate --watch`, `validate`, `format`, `migrate` and `db push` — scaffolding, CI-friendly validation and a canonical formatter for the schema DSL.
The complete feature matrix, including the trade-offs behind each choice.
| Feature | ruprizzleSchema-first Rust ORM | DieselTyped Rust ORM | SeaORMEntity-first Rust ORM | sqlxSQL toolkit | Prisma Client RustPrisma-style client |
|---|---|---|---|---|---|
| Schema-first code generation | Yes | Partial | No | No | Yes |
| Declarative schema DSL | Yes | No | No | No | Yes |
| Type-safe column tokens | Yes | Yes | Partial | No | Yes |
| Type-safe nested `include` | Yes | No | Partial | No | Yes |
| SQL-first, visible query builder | Yes | Partial | No | Yes | Partial |
| `.to_sql()` on every builder | Yes | No | No | Not applicable | Partial |
| Migrations from schema diff | Yes | No | Partial | No | Partial |
| Compile-time query checking | Planned | Yes | No | Yes | Not applicable |
| No sidecar / no hidden engine | Yes | Yes | Yes | Yes | No |
| Native async / `await` | Yes | Partial | Yes | Yes | Yes |
| Postgres + SQLite | Yes | Yes | Yes | Yes | Partial |
| Built on `sqlx` | Yes | No | Yes | Not applicable | No |
What teams ask before adopting ruprizzle.
Not yet. `0.4.0-beta.2` is published on crates.io and the core implementation is complete, but the public API is still stabilising. Known gaps are documented rather than glossed over: no compile-time checked raw SQL, no schema LSP, no automatic handling of mutual foreign-key cycles, and no heuristic column-rename detection.
Postgres 17+ and SQLite 3+ from day one, behind a `DbDialect` trait. Dialect capabilities — native enums, native UUID, RETURNING, ALTER COLUMN, partial indexes, max bind parameters — are modelled explicitly, so a difference between Postgres and SQLite surfaces at build time rather than at runtime. MySQL/MariaDB is additive and planned for 0.2.
Diesel gives you strong types but hand-written migrations and a macro-heavy DSL. SeaORM is ergonomic but the schema is not the single source of truth, so generated code can drift. ruprizzle inverts that: you edit `schema.ruprizzle`, run `ruprizzle generate`, and the client and migrations follow.
No. There is no sidecar binary, no WASM engine and no hidden thread pool. The generated client is plain Rust that calls sqlx directly, so ruprizzle inherits sqlx's connection pooling and wire protocol rather than reimplementing them.
Yes, and it is a first-class path rather than a fallback. `raw()` fragments, `db.fetch_all_raw(...)`, `db.execute_raw(...)` and sqlx `query_as!` interop all work alongside the generated client.
They are not in your dependency graph. The parser and codegen crates are build-time tools used by the CLI; the runtime crate your application depends on pulls in only sqlx, serde, chrono, uuid and rust_decimal.
Install the CLI with `cargo install ruprizzle-cli` and add the runtime to your project with `cargo add ruprizzle`. Then `ruprizzle init --provider postgres`, edit your schema, and run `ruprizzle migrate dev --name init`. The minimum supported Rust version is 1.85.
Have questions or need something tailored to your business? We'd love to help you get started.