PSQL driver implementation.
More...
#include <PostgresDriverInstanceImpl.h>
PSQL driver implementation.
◆ PostgresDriverInstanceImpl()
impl::PostgresDriverInstanceImpl::PostgresDriverInstanceImpl |
( |
PGconn * | conn | ) |
|
|
explicitnoexcept |
◆ ~PostgresDriverInstanceImpl()
impl::PostgresDriverInstanceImpl::~PostgresDriverInstanceImpl |
( |
| ) |
|
|
overridenoexcept |
◆ begin()
bool impl::PostgresDriverInstanceImpl::begin |
( |
| ) |
|
|
nodiscardoverridevirtualnoexcept |
◆ commit()
bool impl::PostgresDriverInstanceImpl::commit |
( |
| ) |
|
|
nodiscardoverridevirtualnoexcept |
◆ createStatement()
◆ executeQuery()
ResultSet::Ptr impl::PostgresDriverInstanceImpl::executeQuery |
( |
const char * | sql | ) |
|
|
overridevirtualnoexcept |
◆ executeUpdate()
int64_t impl::PostgresDriverInstanceImpl::executeUpdate |
( |
const char * | sql | ) |
|
|
overridevirtualnoexcept |
Execute the update
- Parameters
-
- Returns
- Count the number of rows updated
- Return values
-
Implements sese::db::DriverInstance.
◆ getAutoCommit()
bool impl::PostgresDriverInstanceImpl::getAutoCommit |
( |
bool & | status | ) |
|
|
nodiscardoverridevirtualnoexcept |
Checks whether auto-commit is enabled
- Warning
- Since libpq does not support retrieving the autoCommit status, it is recommended to use the command line to obtain this value when using PostgreSQL.
- Return values
-
false | If the operation fails |
Implements sese::db::DriverInstance.
◆ getInsertId()
bool impl::PostgresDriverInstanceImpl::getInsertId |
( |
int64_t & | id | ) |
const |
|
nodiscardoverridevirtualnoexcept |
Retrieves the auto-incremented ID
- Warning
- Since libpq does not support retrieving the auto-incremented ID, it is recommended to use the command line with the query ‘SELECT currval(pg_get_serial_sequence('tabName’, 'colName'))` to get the auto-incremented ID when using PostgreSQL.
- Return values
-
false | If the retrieval fails |
Implements sese::db::DriverInstance.
◆ getLastError()
int impl::PostgresDriverInstanceImpl::getLastError |
( |
| ) |
const |
|
nodiscardoverridevirtualnoexcept |
Retrieves the error code corresponding to the instance's driver
- Returns
- The error code
Implements sese::db::DriverInstance.
◆ getLastErrorMessage()
const char * impl::PostgresDriverInstanceImpl::getLastErrorMessage |
( |
| ) |
const |
|
nodiscardoverridevirtualnoexcept |
Retrieves the error message corresponding to the instance's driver (null check required)
- Returns
- The error message
Implements sese::db::DriverInstance.
◆ rollback()
bool impl::PostgresDriverInstanceImpl::rollback |
( |
| ) |
|
|
nodiscardoverridevirtualnoexcept |
◆ setAutoCommit()
bool impl::PostgresDriverInstanceImpl::setAutoCommit |
( |
bool | enable | ) |
|
|
nodiscardoverridevirtualnoexcept |
Sets the transaction auto-commit mode
- Warning
- Since libpq does not support setting autocommit, and the autoCommit property is global, it is recommended to use
begin()
to start a transaction when using PostgreSQL.
-
Since sqlite3 does not support setting autocommit, it is recommended to use
begin()
to start a transaction when using SQLite.
- Parameters
-
enable | Enable or disable auto-commit mode |
- Return values
-
false | If the operation fails |
Implements sese::db::DriverInstance.
◆ conn
PGconn* sese::db::impl::PostgresDriverInstanceImpl::conn |
|
protected |
◆ error
int sese::db::impl::PostgresDriverInstanceImpl::error = 0 |
|
protected |
◆ rd
std::random_device sese::db::impl::PostgresDriverInstanceImpl::rd {} |
|
protected |
◆ result
PGresult* sese::db::impl::PostgresDriverInstanceImpl::result |
|
protected |
The documentation for this class was generated from the following files: