Crate drizzle_cli

Crate drizzle_cli 

Source
Expand description

Drizzle CLI - Command-line interface for drizzle-rs migrations

This crate provides a standalone CLI tool for managing database migrations using a drizzle.config.toml configuration file instead of requiring Rust code.

§Quick Start

  1. Install the CLI: cargo install drizzle-cli
  2. Run drizzle init to create a drizzle.config.toml
  3. Run drizzle generate to create migrations

§Configuration

Create a drizzle.config.toml file in your project root (or run drizzle init):

dialect = "sqlite"
schema = "src/schema.rs"
out = "./drizzle"

[dbCredentials]
url = "./dev.db"

For PostgreSQL:

dialect = "postgresql"
schema = "src/schema.rs"
out = "./drizzle"

[dbCredentials]
url = "postgres://user:pass@localhost:5432/mydb"

§Commands

  • drizzle init - Create a new drizzle.config.toml configuration file
  • drizzle generate - Generate a new migration from schema changes
  • drizzle generate --custom - Create an empty migration for manual SQL
  • drizzle status - Show migration status
  • drizzle migrate - Run pending migrations (requires database connection)
  • drizzle push - Push schema directly to database (requires database connection)
  • drizzle introspect - Introspect database and generate snapshot (requires database connection)

Re-exports§

pub use config::Config;
pub use config::Credentials;
pub use config::Dialect;
pub use config::Driver;
pub use config::Error as ConfigError;
pub use error::CliError;

Modules§

commands
CLI command implementations
config
Configuration for Drizzle CLI
db
Database connection and migration execution for CLI commands
error
Error types for the CLI
output
CLI output helpers for consistent, drizzle-kit-like formatting.
snapshot
Schema snapshot builder from parsed schema files

Type Aliases§

DrizzleConfig