# Getting Started with ruprizzle: A Schema-First Rust ORM
ruprizzle is a schema-first ORM for Rust. You edit a declarative schema.ruprizzle file, run ruprizzle generate, and the tool produces a typed Rust client and migration SQL from the schema diff. The generated client is plain Rust calling sqlx, with no hidden query engine or sidecar binary, and .to_sql() on every builder shows the exact SQL.
## What you get
A ruprizzle project gives you a declarative schema, a generated typed client with per-model column tokens, type-safe query building, automatic migration diffing, and Postgres and SQLite support from day one.
## Step 1: Install the CLI
Install the ruprizzle CLI with Cargo:
cargo install ruprizzle-cli
This gives you the ruprizzle command for generating code, running migrations and formatting the schema.
## Step 2: Create a project
Run:
ruprizzle init --provider postgres
This creates a new project with a starter schema.ruprizzle file and a Cargo project already configured to use the generated client.
## Step 3: Add the runtime
In your Cargo.toml, or directly during init, add the ruprizzle runtime:
cargo add ruprizzle
The runtime is the library your application code uses to query the database.
## Step 4: Edit the schema
Open schema.ruprizzle and add your first model. For example, a User model with an email and created_at field. The schema is declarative, similar to a Prisma schema.
## Step 5: Generate the client and migration
Run:
ruprizzle generate
This diffs your schema against the last snapshot, writes up.sql and down.sql, and regenerates the typed Rust client. You can inspect the SQL before applying it.
## Step 6: Apply the migration
Run:
ruprizzle migrate dev --name init
This applies the migration to your development database.
## Step 7: Query the database
Use the generated client to build type-safe queries. Call .to_sql() on any query builder to see the SQL that will run. The client is plain Rust calling sqlx, so you can drop down to raw SQL or sqlx whenever you need to.
## Status and requirements
ruprizzle is in beta at 0.4.0-beta.2. The core is complete and published on crates.io. The minimum supported Rust version is 1.85.
Frequently Asked Questions
Do I need to write SQL by hand?
No. ruprizzle generates migration SQL from the diff between your current schema and the last snapshot. You can inspect and edit it before applying.
Can I see the SQL before it runs?
Yes. Call .to_sql() on any query builder to see the generated SQL.
Which databases does ruprizzle support?
Postgres 17+ and SQLite 3+ from day one. MySQL/MariaDB is planned for 0.2.
Ready to transform your data infrastructure?
Let's discuss how these insights apply to your organization and create a roadmap for your data transformation journey.
