The only row, or a .NOT_FOUND error when there is none. More rows are a .USAGE error. The row
lives in temporary storage (until reset_temporary_storage).
- 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.
- call: the code of the call, which lets the query text be checked while compiling. Leave the default.
query_one :: (
db: $D,
$sql: string,
args: ..Any,
plan := Plan.AUTO,
json := Json_Options.{},
$call := #caller_code
) -> (#run row_type(sql, call, 1, #insert,scope(call) #run row_table_type(sql, call, 1, #insert,scope(call) #run row_table_exists(sql, call, 1)), Row(#run row_shape(sql, call, 1))), Pg_Error)
The only row, or a .NOT_FOUND error when there is none. More rows are a .USAGE error. The row
lives in temporary storage (until reset_temporary_storage).
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.
- $call := #caller_code
- the code of the call, which lets the query text be checked while compiling. Leave the default.
Returns
- #run row_type(sql, call, 1, #insert,scope(call) #run row_table_type(sql, call, 1, #insert,scope(call) #run row_table_exists(sql, call, 1)), Row(#run row_shape(sql, call, 1)))