pub enum Driver {
Rusqlite,
Libsql,
Turso,
PostgresSync,
TokioPostgres,
D1Http,
DurableSqlite,
AwsDataApi,
}Expand description
Database driver for Rust database connections
Variants§
Rusqlite
rusqlite - synchronous SQLite driver
Libsql
libsql - LibSQL driver (local embedded)
Turso
turso - Turso cloud driver (remote)
PostgresSync
postgres-sync - synchronous PostgreSQL driver
TokioPostgres
tokio-postgres - async PostgreSQL driver
D1Http
d1-http - Cloudflare D1 over the HTTP API
Targets a remote D1 database via the Cloudflare REST API. Requires
accountId, databaseId, and token in dbCredentials. For deploying
to a Worker binding at runtime use the d1 driver feature on the
drizzle crate itself — this CLI driver is for schema ops (generate /
push / pull / migrate) against a live D1 instance from your dev box.
DurableSqlite
durable-sqlite - Cloudflare Durable Objects SQLite storage
DOs run SQLite embedded inside the Worker runtime. There’s no remote
endpoint to push to from the CLI, so this driver is schema-only:
generate produces SQL migrations and a bundled migrations.js index
(like drizzle-kit’s bundle: true) that the Worker imports at build
time to apply migrations inside DurableObject::new().
AwsDataApi
aws-data-api - AWS RDS Data API (Aurora Serverless PostgreSQL)
Runs SQL through the AWS RDS Data API instead of a direct TCP
connection. Requires database, secretArn (AWS Secrets Manager ARN
holding the DB password), and resourceArn (Aurora cluster ARN) in
dbCredentials. The AWS region comes from the standard SDK chain
(env vars, ~/.aws/config, EC2/ECS metadata) — drizzle-kit takes no
region field and we match that.
At the Rust layer this would route through the aws-sdk-rdsdata crate,
which isn’t yet wired into drizzle-rs — this driver is currently
recognized by the CLI for config parity, but operations return a
pointed UnsupportedForDriver error.
Implementations§
Source§impl Driver
impl Driver
pub const ALL: &'static [&'static str]
pub const fn as_str(self) -> &'static str
pub const fn valid_for(dialect: Dialect) -> &'static [Self]
pub const fn is_valid_for(self, dialect: Dialect) -> bool
Sourcepub const fn is_codegen_only(self) -> bool
pub const fn is_codegen_only(self) -> bool
True for drivers that only make sense as schema/codegen targets — i.e.
drivers where the CLI has no way to connect to a live DB from the dev
machine (e.g. Durable Objects SQLite runs inside the Workers runtime).
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Driver
impl<'de> Deserialize<'de> for Driver
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for Driver
impl JsonSchema for Driver
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read more