drizzle-cli 0.4.2

Command-line interface for drizzle-rs migrations
Documentation
[package]
name = "drizzle-cli"
version.workspace = true
edition.workspace = true
authors.workspace = true
description = "Command-line interface for drizzle-rs migrations"
license.workspace = true
repository.workspace = true
rust-version.workspace = true

[[bin]]
name = "drizzle"
path = "src/main.rs"

# cargo-binstall: download the prebuilt binary from a GitHub release instead
# of building from source. URL template matches the artifacts produced by
# `.github/workflows/release.yml`:
#   v{ version }/drizzle-{ target }{ archive-suffix }
[package.metadata.binstall]
pkg-url = "{ repo }/releases/download/v{ version }/drizzle-{ target }{ archive-suffix }"
pkg-fmt = "tgz"
bin-dir = "{ bin }{ binary-ext }"

[package.metadata.binstall.overrides.x86_64-pc-windows-msvc]
pkg-fmt = "zip"

[dependencies]
# Core drizzle dependencies
drizzle-migrations = { workspace = true }
# `drizzle seed`; each driver feature enables its dialect below.
drizzle-seed = { workspace = true, features = ["migrations"] }
drizzle-types = { workspace = true, features = ["std", "serde", "schemars", "uuid", "chrono", "time", "geo-types", "cidr", "bit-vec"] }

# CLI framework
clap = { workspace = true }
colored = { workspace = true }
heck = { workspace = true }
inquire = { workspace = true }

# Configuration
toml = { workspace = true }
schemars = { workspace = true }
serde = { workspace = true, features = ["derive"] }
serde_json = { workspace = true }

# File discovery
glob = { workspace = true }

# Error handling
thiserror = { workspace = true }
anyhow = { workspace = true }

# Environment variables
dotenvy = "0.15"

# Driver dependencies (optional, per-driver for push/migrate/introspect)
rusqlite = { workspace = true, optional = true, features = ["bundled"] }
postgres = { workspace = true, optional = true }
postgres-native-tls = { workspace = true, optional = true }
native-tls = { workspace = true, optional = true }
# Shared URL/host config parsing for both postgres drivers (see PostgresCreds).
tokio-postgres = { workspace = true, optional = true }
tokio = { workspace = true, optional = true, features = ["rt", "macros"] }
libsql = { workspace = true, optional = true }
mysql = { workspace = true, optional = true }
mysql_async = { workspace = true, optional = true }
mysql_common = { workspace = true, optional = true }

# HTTP client for d1-http driver (Cloudflare REST API).
# rustls-tls avoids requiring a system openssl on Windows/macOS devs.
reqwest = { version = "0.13", optional = true, default-features = false, features = ["json", "rustls"] }

[dev-dependencies]
tempfile = { workspace = true }
assert_cmd = { workspace = true }
predicates = { workspace = true }
# `import` tests hash migrations the way drizzle-orm does.
sha2 = { workspace = true }

[features]
# CI builds the CLI with no driver and with each driver feature alone
# (ci.yml, "Check CLI driver builds for warnings"). List new drivers there.
default = []

# SQLite drivers
rusqlite = ["dep:rusqlite", "drizzle-seed/sqlite"]
libsql = ["dep:libsql", "dep:tokio", "drizzle-seed/sqlite"]
# Turso (remote) connects through the libsql client.
turso = ["dep:libsql", "dep:tokio", "drizzle-seed/sqlite"]

# PostgreSQL drivers
# Both drivers need `tokio-postgres` for `PostgresCreds::connection_config`
# (URL/host → `tokio_postgres::Config`). The sync driver additionally pulls
# the `postgres` crate; the async driver pulls `tokio`.
postgres-sync = [
  "drizzle-seed/postgres",
  "dep:postgres",
  "dep:tokio-postgres",
  "dep:postgres-native-tls",
  "dep:native-tls",
]
tokio-postgres = [
  "drizzle-seed/postgres",
  "dep:tokio-postgres",
  # The workspace dep leaves `runtime` off so wasm targets can use
  # tokio-postgres without `tokio/net`; the CLI dials real sockets.
  "tokio-postgres/runtime",
  "dep:postgres-native-tls",
  "dep:native-tls",
  "dep:tokio",
]

# MySQL drivers. Both use mysql_common's value and row boundary types; the
# async adapter also needs a Tokio runtime for socket I/O.
mysql-sync = ["dep:mysql", "dep:mysql_common", "drizzle-seed/mysql"]
mysql-async = ["dep:mysql_async", "dep:mysql_common", "dep:tokio", "drizzle-seed/mysql"]

# Cloudflare D1 HTTP driver (CLI-only — runtime D1 uses the Worker binding via
# the main `drizzle` crate's `d1` feature, not this).
d1-http = ["dep:reqwest", "dep:tokio", "drizzle-seed/sqlite"]

# These used to forward value types to drizzle-seed, which the CLI never
# used. They do nothing now and remain so existing install commands keep
# working.
uuid = []
serde = []
chrono = []
cidr = []
geo-types = []
bit-vec = []

# Convenience bundles
sqlite-all = ["rusqlite", "libsql", "turso", "d1-http"]
postgres-all = ["postgres-sync", "tokio-postgres"]
mysql-all = ["mysql-sync", "mysql-async"]