Skip to main content

Commands

Enum Commands 

Source
pub enum Commands {
Show 14 variants Split { file: PathBuf, output: PathBuf, dialect: Option<String>, tables: Option<String>, schema_only: bool, data_only: bool, verbose: bool, progress: bool, json: bool, dry_run: bool, fail_fast: bool, }, Analyze { file: PathBuf, dialect: Option<String>, progress: bool, json: bool, fail_fast: bool, }, Merge { input_dir: PathBuf, output: Option<PathBuf>, dialect: Option<String>, tables: Option<String>, exclude: Option<String>, transaction: bool, no_header: bool, progress: bool, json: bool, dry_run: bool, }, Sample {
Show 19 fields file: PathBuf, output: Option<PathBuf>, dialect: Option<String>, config: Option<PathBuf>, percent: Option<u32>, rows: Option<usize>, seed: Option<u64>, tables: Option<String>, exclude: Option<String>, root_tables: Option<String>, include_global: Option<String>, preserve_relations: bool, strict_fk: bool, no_schema: bool, max_total_rows: Option<usize>, no_limit: bool, progress: bool, json: bool, dry_run: bool,
}, Shard {
Show 16 fields file: PathBuf, output: Option<PathBuf>, dialect: Option<String>, config: Option<PathBuf>, tenant_column: Option<String>, tenant_value: Option<String>, tenant_values: Option<String>, root_tables: Option<String>, include_global: Option<String>, strict_fk: bool, no_schema: bool, max_selected_rows: Option<usize>, no_limit: bool, progress: bool, json: bool, dry_run: bool,
}, Convert { file: PathBuf, output: Option<PathBuf>, from: Option<String>, to: String, strict: bool, progress: bool, json: bool, dry_run: bool, fail_fast: bool, }, Validate { file: PathBuf, dialect: Option<String>, strict: bool, no_fk_checks: bool, fail_fast: bool, max_rows_per_table: usize, no_limit: bool, progress: bool, json: bool, }, Diff {
Show 16 fields old_file: PathBuf, new_file: PathBuf, output: Option<PathBuf>, dialect: Option<String>, tables: Option<String>, exclude: Option<String>, ignore_columns: Option<String>, schema_only: bool, data_only: bool, primary_key: Option<String>, allow_no_pk: bool, ignore_order: bool, max_pk_entries: usize, format: Option<String>, verbose: bool, progress: bool,
}, Redact {
Show 19 fields file: PathBuf, output: Option<PathBuf>, dialect: Option<String>, config: Option<PathBuf>, generate_config: bool, null: Vec<String>, hash: Vec<String>, fake: Vec<String>, mask: Vec<String>, constant: Vec<String>, seed: Option<u64>, locale: String, tables: Vec<String>, exclude: Vec<String>, strict: bool, progress: bool, dry_run: bool, json: bool, validate: bool,
}, Graph {
Show 15 fields file: PathBuf, output: Option<PathBuf>, format: Option<String>, dialect: Option<String>, layout: Option<String>, cycles_only: bool, table: Option<String>, transitive: bool, reverse: bool, tables: Option<String>, exclude: Option<String>, max_depth: Option<usize>, render: bool, progress: bool, json: bool,
}, Order { file: PathBuf, output: Option<PathBuf>, dialect: Option<String>, check: bool, dry_run: bool, reverse: bool, }, Query(QueryArgs), Schema { output: PathBuf, command: Option<String>, stdout: bool, list: bool, }, Completions { shell: Shell, },
}

Variants§

§

Split

Split a SQL dump into individual table files

Fields

§file: PathBuf

Input SQL file or glob pattern (e.g., .sql, dumps/**/.sql)

§output: PathBuf

Output directory for split files

§dialect: Option<String>

SQL dialect: mysql, postgres, sqlite, mssql (auto-detected if omitted)

§tables: Option<String>

Only split specific tables (comma-separated)

§schema_only: bool

Only include schema statements (CREATE, ALTER, DROP)

§data_only: bool

Only include data statements (INSERT, COPY)

§verbose: bool

Show verbose output

§progress: bool

Show progress bar

§json: bool

Output results as JSON

§dry_run: bool

Preview without writing files

§fail_fast: bool

Stop on first error (for glob patterns)

§

Analyze

Analyze a SQL dump and display table statistics

Fields

§file: PathBuf

Input SQL file or glob pattern

§dialect: Option<String>

SQL dialect: mysql, postgres, sqlite, mssql (auto-detected if omitted)

§progress: bool

Show progress bar

§json: bool

Output results as JSON

§fail_fast: bool

Stop on first error (for glob patterns)

§

Merge

Merge split SQL files back into a single dump

Fields

§input_dir: PathBuf

Directory containing split SQL files

§output: Option<PathBuf>

Output SQL file (default: stdout)

§dialect: Option<String>

SQL dialect for output formatting

§tables: Option<String>

Only merge specific tables (comma-separated)

§exclude: Option<String>

Exclude specific tables (comma-separated)

§transaction: bool

Wrap output in BEGIN/COMMIT transaction

§no_header: bool

Omit header comments

§progress: bool

Show progress bar

§json: bool

Output results as JSON

§dry_run: bool

Preview without writing files

§

Sample

Create a reduced dataset preserving FK relationships

Fields

§file: PathBuf

Input SQL file (supports .gz, .bz2, .xz, .zst)

§output: Option<PathBuf>

Output SQL file (default: stdout)

§dialect: Option<String>

SQL dialect: mysql, postgres, sqlite, mssql (auto-detected if omitted)

§config: Option<PathBuf>

YAML config file for per-table settings

§percent: Option<u32>

Sample percentage of rows (1-100)

§rows: Option<usize>

Sample fixed number of rows per table

§seed: Option<u64>

Random seed for reproducible sampling

§tables: Option<String>

Only sample specific tables (comma-separated)

§exclude: Option<String>

Exclude specific tables (comma-separated)

§root_tables: Option<String>

Tables to start sampling from (comma-separated)

§include_global: Option<String>

Handle lookup tables: none, lookups, all

§preserve_relations: bool

Maintain FK integrity by including referenced rows

§strict_fk: bool

Fail on FK integrity violations

§no_schema: bool

Exclude CREATE TABLE statements from output

§max_total_rows: Option<usize>

Max total rows to sample (0 = unlimited)

§no_limit: bool

Disable row limit

§progress: bool

Show progress bar

§json: bool

Output results as JSON

§dry_run: bool

Preview without writing files

§

Shard

Extract tenant-specific data from a multi-tenant dump

Fields

§file: PathBuf

Input SQL file (supports .gz, .bz2, .xz, .zst)

§output: Option<PathBuf>

Output SQL file or directory (default: stdout)

§dialect: Option<String>

SQL dialect: mysql, postgres, sqlite, mssql (auto-detected if omitted)

§config: Option<PathBuf>

YAML config file for table classification

§tenant_column: Option<String>

Column containing tenant ID (auto-detected if omitted)

§tenant_value: Option<String>

Single tenant value to extract

§tenant_values: Option<String>

Multiple tenant values (comma-separated, outputs to directory)

§root_tables: Option<String>

Tables containing tenant column (comma-separated)

§include_global: Option<String>

Handle lookup tables: none, lookups, all

§strict_fk: bool

Fail on FK integrity violations

§no_schema: bool

Exclude CREATE TABLE statements from output

§max_selected_rows: Option<usize>

Max rows to select (0 = unlimited)

§no_limit: bool

Disable row limit

§progress: bool

Show progress bar

§json: bool

Output results as JSON

§dry_run: bool

Preview without writing files

§

Convert

Convert a SQL dump between MySQL, PostgreSQL, and SQLite

Fields

§file: PathBuf

Input SQL file or glob pattern

§output: Option<PathBuf>

Output SQL file or directory (default: stdout)

§from: Option<String>

Source dialect (auto-detected if omitted)

§to: String

Target dialect (required)

§strict: bool

Fail on unsupported features instead of warning

§progress: bool

Show progress bar

§json: bool

Output results as JSON

§dry_run: bool

Preview without writing files

§fail_fast: bool

Stop on first error (for glob patterns)

§

Validate

Validate SQL dump syntax, encoding, and data integrity

Fields

§file: PathBuf

Input SQL file or glob pattern

§dialect: Option<String>

SQL dialect: mysql, postgres, sqlite, mssql (auto-detected if omitted)

§strict: bool

Treat warnings as errors (exit code 1)

§no_fk_checks: bool

Skip PK/FK data integrity checks

§fail_fast: bool

Stop on first error (for glob patterns)

§max_rows_per_table: usize

Max rows per table for PK/FK checks (0 = unlimited)

§no_limit: bool

Disable row limit for PK/FK checks

§progress: bool

Show progress bar

§json: bool

Output results as JSON

§

Diff

Compare two SQL dumps and report schema + data differences

Fields

§old_file: PathBuf

Original SQL dump file

§new_file: PathBuf

Updated SQL dump file

§output: Option<PathBuf>

Output file (default: stdout)

§dialect: Option<String>

SQL dialect: mysql, postgres, sqlite, mssql (auto-detected if omitted)

§tables: Option<String>

Only compare these tables (comma-separated)

§exclude: Option<String>

Exclude these tables (comma-separated)

§ignore_columns: Option<String>

Ignore columns matching glob patterns (e.g., *.updated_at)

§schema_only: bool

Compare schema only, skip data

§data_only: bool

Compare data only, skip schema

§primary_key: Option<String>

Override primary key (format: table:col1+col2,table2:col)

§allow_no_pk: bool

Compare tables without PK using all columns as key

§ignore_order: bool

Ignore column order differences in schema

§max_pk_entries: usize

Max PK entries per table (limits memory)

§format: Option<String>

Output format: text, json, sql

§verbose: bool

Show sample PK values for changes

§progress: bool

Show progress bar

§

Redact

Redact sensitive data (PII) from SQL dumps

Fields

§file: PathBuf

Input SQL file (supports .gz, .bz2, .xz, .zst)

§output: Option<PathBuf>

Output file (default: stdout)

§dialect: Option<String>

SQL dialect: mysql, postgres, sqlite, mssql (auto-detected if omitted)

§config: Option<PathBuf>

YAML config file for redaction rules

§generate_config: bool

Generate annotated YAML config by analyzing input file

§null: Vec<String>

Columns to set to NULL (glob patterns, comma-separated)

§hash: Vec<String>

Columns to hash with SHA256 (glob patterns)

§fake: Vec<String>

Columns to replace with fake data (glob patterns)

§mask: Vec<String>

Columns to mask (format: pattern=column, e.g., “***-XXXX=.credit_card”)

§constant: Vec<String>

Column=value pairs for constant replacement

§seed: Option<u64>

Random seed for reproducible redaction

§locale: String

Locale for fake data generation (default: en)

§tables: Vec<String>

Only redact specific tables (comma-separated)

§exclude: Vec<String>

Exclude specific tables (comma-separated)

§strict: bool

Fail on warnings (e.g., unsupported locale)

§progress: bool

Show progress bar

§dry_run: bool

Preview without writing files

§json: bool

Output results as JSON

§validate: bool

Validate config only, don’t process

§

Graph

Generate Entity Relationship Diagram (ERD) from SQL dump

Fields

§file: PathBuf

Input SQL file (supports .gz, .bz2, .xz, .zst)

§output: Option<PathBuf>

Output file (.html, .dot, .mmd, .json, .png, .svg)

§format: Option<String>

Output format: html, dot, mermaid, json

§dialect: Option<String>

SQL dialect: mysql, postgres, sqlite, mssql (auto-detected if omitted)

§layout: Option<String>

Layout direction: lr (left-right), tb (top-bottom)

§cycles_only: bool

Show only tables involved in circular dependencies

§table: Option<String>

Focus on a specific table

§transitive: bool

Show transitive dependencies (parents of parents)

§reverse: bool

Show reverse dependencies (who references this table)

§tables: Option<String>

Only include these tables (comma-separated, supports globs)

§exclude: Option<String>

Exclude these tables (comma-separated, supports globs)

§max_depth: Option<usize>

Maximum depth for transitive dependencies

§render: bool

Render DOT to PNG/SVG using Graphviz

§progress: bool

Show progress bar

§json: bool

Output results as JSON

§

Order

Output SQL dump with tables in topological FK order

Fields

§file: PathBuf

Input SQL file (supports .gz, .bz2, .xz, .zst)

§output: Option<PathBuf>

Output file (default: stdout)

§dialect: Option<String>

SQL dialect: mysql, postgres, sqlite, mssql (auto-detected if omitted)

§check: bool

Verify ordering without writing output

§dry_run: bool

Show order without rewriting the file

§reverse: bool

Order children before parents (for DROP operations)

§

Query(QueryArgs)

Query SQL dumps using DuckDB’s analytical engine

§

Schema

Generate JSON schemas for –json output types (developer tool)

Fields

§output: PathBuf

Output directory for schema files

§command: Option<String>

Generate schema for a specific command only

§stdout: bool

Print schemas to stdout instead of writing files

§list: bool

List available schema names

§

Completions

Generate shell completion scripts

Fields

§shell: Shell

Target shell

Trait Implementations§

Source§

impl FromArgMatches for Commands

Source§

fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>

Instantiate Self from ArgMatches, parsing the arguments as needed. Read more
Source§

fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>

Instantiate Self from ArgMatches, parsing the arguments as needed. Read more
Source§

fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>

Assign values from ArgMatches to self.
Source§

fn update_from_arg_matches_mut<'b>( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>

Assign values from ArgMatches to self.
Source§

impl Subcommand for Commands

Source§

fn augment_subcommands<'b>(__clap_app: Command) -> Command

Append to Command so it can instantiate Self via FromArgMatches::from_arg_matches_mut Read more
Source§

fn augment_subcommands_for_update<'b>(__clap_app: Command) -> Command

Append to Command so it can instantiate self via FromArgMatches::update_from_arg_matches_mut Read more
Source§

fn has_subcommand(__clap_name: &str) -> bool

Test whether Self can parse a specific subcommand

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> Fake for T

Source§

fn fake<U>(&self) -> U
where Self: FakeBase<U>,

Source§

fn fake_with_rng<U, R>(&self, rng: &mut R) -> U
where R: Rng + ?Sized, Self: FakeBase<U>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,