Drizzle RS
A type-safe SQL query builder / ORM-ish layer for Rust, inspired by Drizzle ORM.
[!WARNING] This project is still evolving. Expect breaking changes.
What’s in the box
- Type-safe SQL builder: compile-time checked expressions and query building.
- Schema macros:
#[SQLiteTable],#[PostgresTable],#[derive(SQLiteSchema)], etc. - Migrations + CLI: generate/apply migrations and introspect schema via the
drizzlebinary.
Install
Library
Pick a database driver feature (drivers imply the corresponding dialect module):
[]
= { = "0.1.3", = ["rusqlite"] } # or: libsql / turso / postgres-sync / tokio-postgres
CLI
Install the drizzle binary with the driver(s) you want:
# SQLite (sync)
# PostgreSQL (sync)
# Turso / LibSQL (async)
Quick start (SQLite + rusqlite)
use eq;
use *;
use Drizzle;
For more complete examples (including JOIN mapping via
#[derive(SQLiteFromRow)]), see examples/ and tests/.
CLI quick start (migrations)
Feature flags (library)
| Feature | Enables |
|---|---|
sqlite |
SQLite dialect module re-exports (drizzle::sqlite) |
postgres |
PostgreSQL dialect module re-exports (drizzle::postgres) |
rusqlite |
SQLite sync driver (drizzle::sqlite::rusqlite) |
libsql |
SQLite async driver (drizzle::sqlite::libsql) |
turso |
Turso/LibSQL async driver (drizzle::sqlite::turso) |
postgres-sync |
PostgreSQL sync driver (drizzle::postgres::sync) |
tokio-postgres |
PostgreSQL async driver (drizzle::postgres::tokio) |
uuid |
UUID support |
serde |
JSON support (serde/serde_json integration) |
chrono / cidr / geo-types / bit-vec |
Optional PostgreSQL types |
arrayvec |
Fixed-capacity strings/arrays support |
Development
- Build:
cargo build --all-features - Test (SQLite):
cargo test --features "rusqlite,uuid" - Test (PostgreSQL, Docker):
just test-pg - Lint (nightly):
cargo clippy --all-features -- -D warnings
More commands and repo details live in CLAUDE.md.
License
MIT — see LICENSE.