Runs one statement like query_dynamic, prepared under a name and kept in the connection's cache
(unless plan is .CUSTOM or the cache is off): the first run parses it, later runs with the
same text and parameter types only bind. Typed queries do this on their own.
- c: the connection to run on.
- sql: the statement text, with
$1,$2, ... for the arguments. - args: one value per parameter, in order.
- plan:
.AUTOprepares and caches the statement;.CUSTOMuses the unnamed statement. - binary: return result values in the binary format instead of text.
query_cached :: (
c: *Connection,
sql: string,
args: ..Any,
plan := Plan.AUTO,
binary := false
) -> (Result, Pg_Error)
Runs one statement like query_dynamic, prepared under a name and kept in the connection's cache
(unless plan is .CUSTOM or the cache is off): the first run parses it, later runs with the
same text and parameter types only bind. Typed queries do this on their own.
Parameters
- c: *Connection
- the connection to run on.
- sql: string
- the statement text, with
$1,$2, ... for the arguments. - args: ..Any
- one value per parameter, in order.
- plan := Plan.AUTO
.AUTOprepares and caches the statement;.CUSTOMuses the unnamed statement.- binary := false
- return result values in the binary format instead of text.