with Statement
Creates a statement from the given SQL statement, runs the function, commits the changes and closes the connection.
If all connections are used, this function blocks until a connection is available.
The function should always be short-lived, consider using withTransaction otherwise.
Supports nesting, but it is not recommended doing so, avoid nesting by returning the data as soon as possible.
Parameters
An SQL statement that may contain one or more '?' IN parameter placeholders
The function to run with the prepared statement
See also
Creates a statement from the given SQL statement, runs the function, commits the changes and closes the connection.
If all connections are used, this function blocks until a connection is available.
The function should always be short-lived, consider using withTransaction otherwise.
Supports nesting, but it is not recommended doing so, avoid nesting by returning the data as soon as possible.
Parameters
An SQL statement that may contain one or more '?' IN parameter placeholders
true
if the database only is read from, can allow some optimizations but does not prevent writing
The function to run with the prepared statement
See also
Creates a statement from the given SQL statement, runs the function, commits the changes and closes the connection.
The returned keys are accessible using getGeneratedKeys().
If all connections are used, this function blocks until a connection is available.
The function should always be short-lived, consider using withTransaction otherwise.
Supports nesting, but it is not recommended doing so, avoid nesting by returning the data as soon as possible.
Parameters
An SQL statement that may contain one or more '?' IN parameter placeholders
An array of column index indicating the columns that should be returned from the inserted row or rows
The function to run with the prepared statement
See also
Creates a statement from the given SQL statement, runs the function, commits the changes and closes the connection.
The returned keys are accessible using getGeneratedKeys().
If all connections are used, this function blocks until a connection is available.
The function should always be short-lived, consider using withTransaction otherwise.
Supports nesting, but it is not recommended doing so, avoid nesting by returning the data as soon as possible.
Parameters
An SQL statement that may contain one or more '?' IN parameter placeholders
true
if the database only is read from, can allow some optimizations but does not prevent writing
An array of column index indicating the columns that should be returned from the inserted row or rows
The function to run with the prepared statement
See also
Creates a statement from the given SQL statement, runs the function, commits the changes and closes the connection.
The returned keys are accessible using getGeneratedKeys().
If all connections are used, this function blocks until a connection is available.
The function should always be short-lived, consider using withTransaction otherwise.
Supports nesting, but it is not recommended doing so, avoid nesting by returning the data as soon as possible.
Parameters
An SQL statement that may contain one or more '?' IN parameter placeholders
An array of column names indicating the columns that should be returned from the inserted row or rows
The function to run with the prepared statement
See also
Creates a statement from the given SQL statement, runs the function, commits the changes and closes the connection.
The returned keys are accessible using getGeneratedKeys().
If all connections are used, this function blocks until a connection is available.
The function should always be short-lived, consider using withTransaction otherwise.
Supports nesting, but it is not recommended doing so, avoid nesting by returning the data as soon as possible.
Parameters
An SQL statement that may contain one or more '?' IN parameter placeholders
true
if the database only is read from, can allow some optimizations but does not prevent writing
An array of column names indicating the columns that should be returned from the inserted row or rows
The function to run with the prepared statement