nestrs-drizzle is the Rust analogue of NestJS’s
@nestjs/typeorm when Drizzle
is the chosen query builder. The crate re-exports drizzle_orm::* at the
crate root and adds the boot-time module / service shape NestJS apps expect.
Not a workspace member in 1.3.0. Upstream drizzle-orm 0.36 is not
published on crates.io, and crates.io’s drizzle 0.1.x requires MSRV 1.95
(workspace MSRV is 1.88). The nestrs-drizzle/ directory stays on disk for
re-introduction once a compatible crate publishes. Do not add it to
workspace members until then. Use database-sqlx, nestrs-prisma, or
nestrs-sea-orm for production SQL.
Install
Drivers are selected via feature flags — pick exactly one (or all for
multi-driver tools):
postgres — sqlx postgres
mysql — sqlx mysql
sqlite — sqlx sqlite
all — all three (larger compile, but useful for CLI tools)
Boot
The driver is auto-detected from the URL scheme. postgres:// and
postgresql:// flip on is_postgres(), mysql:// and mariadb://
flip on is_mysql(), sqlite:// and sqlite: flip on is_sqlite().
Define a schema
nestrs_drizzle::schema::table re-exports drizzle_orm::table!:
Common column types are re-exported under
nestrs_drizzle::schema::{Int4, Int8, Int2, Text, Bool, Timestamp, Varchar}.
Use the typed query builder
Configuration
DrizzleOptions builder wraps the URL with the driver-tuning knobs the
average app actually reaches for:
parsed() returns a url::Url for the configured connection,
surfacing InvalidUrl if the URL is malformed.
API surface
Feature flags
default = [] — base crate, no SQL backend enabled.
postgres — drizzle-orm/postgres.
mysql — drizzle-orm/mysql.
sqlite — drizzle-orm/sqlite.
all — convenience for all three backends.