Skip to main content

run

Function run 

Source
pub fn run(
    config: &Config,
    db_name: Option<&str>,
    opts: &PushOptions,
) -> Result<(), CliError>
Expand description

Runs drizzle push: introspects the database, diffs it against the schema files (after applying the configured filters), and executes the difference directly, without writing migration files.

--explain prints the planned SQL and stops; --verbose prints it and continues. A destructive plan asks for confirmation unless --force is set.

Before planning, ambiguous renames are asked about on a terminal and otherwise answered from --hints / --hints-file (see renames); --force does not skip them.

ยงErrors

Returns CliError if db_name does not match the config, there are no credentials (CliError::MissingCredentials) or no driver for them, no schema files are found or they have parse errors, introspecting or planning fails, the hints are invalid (CliError::InvalidHints) or leave a rename question unanswered without a terminal (CliError::MissingHints), a statement fails, or the user aborts a prompt or declines a destructive plan (CliError::Aborted).