Postgres module

run_script

procedure · 1 overloadsince 0.27.0Source

Runs SQL that may hold several statements (the simple query protocol) and reports each statement's outcome to hooks. The returned error is the one that stopped the script, after the results of the statements before it were reported. Without an explicit BEGIN the whole string runs as one implicit transaction.

run_script :: (c: *Connection, sql: string, hooks: *Script_Hooks) -> Pg_Error

Runs SQL that may hold several statements (the simple query protocol) and reports each statement's outcome to hooks. The returned error is the one that stopped the script, after the results of the statements before it were reported. Without an explicit BEGIN the whole string runs as one implicit transaction.

Parameters

c: *Connection
the connection.
sql: string
the statements, separated by semicolons.
hooks: *Script_Hooks
what to do with results and COPY data. Null discards all rows.

Returns

See also