Postgrex.close
You're seeing just the function
close
, go back to Postgrex module for more information.
Specs
close(conn(), Postgrex.Query.t(), [option()]) :: :ok | {:error, Exception.t()}
Closes an (extended) prepared query and returns :ok
or
{:error, %Postgrex.Error{}}
if there was an error. Closing a query releases
any resources held by postgresql for a prepared query with that name. See
Postgrex.Query
for the query data.
This function may still raise an exception if there is an issue with types
(ArgumentError
), connection (DBConnection.ConnectionError
), ownership
(DBConnection.OwnershipError
) or other error (RuntimeError
).
Options
:queue
- Whether to wait for connection in a queue (default:true
);:timeout
- Close request timeout (default:15000
);:mode
- set to:savepoint
to use a savepoint to rollback to before the close on error, otherwise set to:transaction
(default::transaction
);
Examples
query = Postgrex.prepare!(conn, "", "CREATE TABLE posts (id serial, title text)")
Postgrex.close(conn, query)