execute_sql

Function execute_sql 

Source
pub fn execute_sql(
    conn: &Connection,
    sql: &str,
    options: &QueryOptions,
    last_select_query: &Arc<Mutex<String>>,
) -> Result<()>
Expand description

Executes a SQL statement and displays the results according to the provided options.

This function handles both SELECT queries, which produce result sets, and other statements (e.g., INSERT, UPDATE, CREATE), which report the number of affected rows.

§Arguments

  • conn - A reference to the active rusqlite::Connection.
  • sql - The SQL string to execute.
  • options - A QueryOptions struct specifying the format, row limit, and other settings.

§Returns

A Result which is Ok(()) on success, or an Err if the query fails to prepare or execute.