|
| PostgreSQLConnection (const PostgreSQLConnection &)=delete |
|
| PostgreSQLConnection (const PostgreSQLConnection &&)=delete |
|
PostgreSQLConnection & | operator= (const PostgreSQLConnection &)=delete |
|
| operator PGconn * () |
|
void | open_url (const std::string &connection_string) |
| Connect to PostgreSQL using a connection URI.
|
|
void | open_test () |
|
std::unique_ptr< Transaction > | transaction (bool readonly=false) override |
| Begin a transaction.
|
|
void | prepare (const std::string &name, const std::string &query) |
| Precompile a query.
|
|
postgresql::Result | exec_unchecked (const char *query) |
|
postgresql::Result | exec_unchecked (const std::string &query) |
|
template<typename STRING > |
void | exec_no_data (STRING query) |
|
template<typename STRING > |
postgresql::Result | exec (STRING query) |
|
template<typename STRING > |
postgresql::Result | exec_one_row (STRING query) |
|
template<typename ... ARGS> |
postgresql::Result | exec_unchecked (const char *query, ARGS... args) |
|
template<typename ... ARGS> |
postgresql::Result | exec_unchecked (const std::string &query, ARGS... args) |
|
template<typename STRING , typename ... ARGS> |
void | exec_no_data (STRING query, ARGS... args) |
|
template<typename STRING , typename ... ARGS> |
postgresql::Result | exec (STRING query, ARGS... args) |
|
template<typename STRING , typename ... ARGS> |
postgresql::Result | exec_one_row (STRING query, ARGS... args) |
|
postgresql::Result | exec_prepared_unchecked (const char *name) |
|
postgresql::Result | exec_prepared_unchecked (const std::string &name) |
|
template<typename STRING > |
void | exec_prepared_no_data (STRING name) |
|
template<typename STRING > |
postgresql::Result | exec_prepared (STRING name) |
|
template<typename STRING > |
postgresql::Result | exec_prepared_one_row (STRING name) |
|
template<typename ... ARGS> |
postgresql::Result | exec_prepared_unchecked (const char *name, ARGS... args) |
|
template<typename ... ARGS> |
postgresql::Result | exec_prepared_unchecked (const std::string &name, ARGS... args) |
|
template<typename STRING , typename ... ARGS> |
void | exec_prepared_no_data (STRING name, ARGS... args) |
|
template<typename STRING , typename ... ARGS> |
postgresql::Result | exec_prepared (STRING name, ARGS... args) |
|
template<typename STRING , typename ... ARGS> |
postgresql::Result | exec_prepared_one_row (STRING name, ARGS... args) |
|
void | cancel_running_query_nothrow () noexcept |
| Send a cancellation command to the server.
|
|
void | discard_all_input_nothrow () noexcept |
| Discard all input from an asynchronous request.
|
|
bool | has_table (const std::string &name) override |
| Check if the database contains a table.
|
|
std::string | get_setting (const std::string &key) override |
| Get a value from the settings table.
|
|
void | set_setting (const std::string &key, const std::string &value) override |
| Set a value in the settings table.
|
|
void | drop_settings () override |
| Drop the settings table.
|
|
void | execute (const std::string &query) override |
| Execute a query without reading its results.
|
|
void | explain (const std::string &query, FILE *out) override |
| Format and print the EXPLAIN output for the query to the given file.
|
|
void | drop_table_if_exists (const char *name) |
| Delete a table in the database if it exists, otherwise do nothing.
|
|
int | changes () |
| Count the number of rows modified by the last query that was run.
|
|
void | pqexec (const std::string &query) |
| Wrap PQexec.
|
|
void | pqexec_nothrow (const std::string &query) noexcept |
| Wrap PQexec but do not throw an exception in case of errors.
|
|
void | run_single_row_mode (const std::string &query_desc, std::function< void(const postgresql::Result &)> dest) |
| Retrieve query results in single row mode.
|
|
void | append_escaped (Querybuf &qb, const char *str) |
| Escape the string as a literal value and append it to qb.
|
|
void | append_escaped (Querybuf &qb, const std::string &str) |
| Escape the string as a literal value and append it to qb.
|
|
void | append_escaped (Querybuf &qb, const std::vector< uint8_t > &buf) |
| Escape the buffer as bytea literal and append it to qb.
|
|
const std::string & | get_url () const |
|
virtual std::unique_ptr< Transaction > | transaction (bool readonly=false)=0 |
| Begin a transaction.
|
|
virtual bool | has_table (const std::string &name)=0 |
| Check if the database contains a table.
|
|
virtual std::string | get_setting (const std::string &key)=0 |
| Get a value from the settings table.
|
|
virtual void | set_setting (const std::string &key, const std::string &value)=0 |
| Set a value in the settings table.
|
|
virtual void | drop_settings ()=0 |
| Drop the settings table.
|
|
virtual void | add_datetime (Querybuf &qb, const Datetime &dt) const |
| Format a datetime and add it to the querybuf.
|
|
virtual void | execute (const std::string &query)=0 |
| Execute a query without reading its results.
|
|
virtual void | explain (const std::string &query, FILE *out)=0 |
| Format and print the EXPLAIN output for the query to the given file.
|
|