Skip to main content

run_sql_file

Function run_sql_file 

Source
pub fn run_sql_file(
    url: &str,
    sql_path: &Path,
    variables: &[String],
    timeout: Duration,
) -> Result<String, String>
Expand description

Run the SQL file at sql_path against url with psql: no .psqlrc, no password prompt, stopping at the first error, unaligned tuples only. Each of variables (name=value) is passed as one -v argument and is referenced in the SQL as :'name', quoted by psql. The connection travels only in PG* variables of the child; output is bounded and database diagnostics are withheld (run_psql).