Skip to main content

execute_with_formatter

Function execute_with_formatter 

Source
pub fn execute_with_formatter<'a, W: Write>(
    db: &Database,
    cmd: SqlCommand,
    batch_mode: &BatchMode,
    ui_mode: UiMode,
    writer: &mut W,
    formatter: Box<dyn Formatter>,
    admin_launcher: Option<Box<dyn FnMut() -> Result<()> + 'a>>,
    limit: Option<usize>,
    quiet: bool,
) -> Result<()>
Expand description

Execute a SQL command with dynamic column detection.

This function creates the StreamingWriter internally based on the query result type, ensuring that SELECT queries use the correct column headers.

ยงArguments

  • db - The database instance.
  • cmd - The SQL command to execute.
  • writer - The output writer.
  • formatter - The formatter to use.
  • limit - Optional row limit.
  • quiet - Whether to suppress warnings.