Runs a statement and returns the number of rows it affected.
project_file names the file whose project (migrations, query cache, .env) the statement
belongs to, when it is not the file of the call: for code that writes statements for others.
- db: a
*Connectionor a*Pool. - sql: the statement, written at the call as a string:
%marks each argument,%%is a literal%. - args: one value per
%, in order. - plan:
.AUTOruns it as a cached named statement;.CUSTOMplans it again on every run. - json: decoding options for json columns in this query; they apply over the connection's and the column's.
- project_file: the file whose project the statement belongs to; empty for the file of the call.
- call: the code of the call, which lets the query text be checked while compiling. Leave the default.
execute :: (
db: $D,
$sql: string,
args: ..Any,
plan := Plan.AUTO,
json := Json_Options.{},
$project_file := "",
$call := #caller_code
) -> (s64, Pg_Error)
Runs a statement and returns the number of rows it affected.
project_file names the file whose project (migrations, query cache, .env) the statement
belongs to, when it is not the file of the call: for code that writes statements for others.
Parameters
- db: $D
- a
*Connectionor a*Pool. - $sql: string
- the statement, written at the call as a string:
%marks each argument,%%is a literal%. - args: ..Any
- one value per
%, in order. - plan := Plan.AUTO
.AUTOruns it as a cached named statement;.CUSTOMplans it again on every run.- json := Json_Options.{}
- decoding options for json columns in this query; they apply over the connection's and the column's.
- $project_file := ""
- the file whose project the statement belongs to; empty for the file of the call.
- $call := #caller_code
- the code of the call, which lets the query text be checked while compiling. Leave the default.
Returns
- s64