|
Sese Framework
3.0.0
A cross-platform framework
|
PSQL prepared statement implementation. More...
#include <PostgresPreparedStatementImpl.h>
Public Member Functions | |
| PostgresPreparedStatementImpl (std::string stmt_name, std::string stmt_string, uint32_t count, PGconn *conn) noexcept | |
| ~PostgresPreparedStatementImpl () noexcept override | |
| ResultSet::Ptr | executeQuery () noexcept override |
| Execute query. | |
| int64_t | executeUpdate () noexcept override |
| Execute update. | |
| bool | setDouble (uint32_t index, const double &value) noexcept override |
| Set double-precision floating-point value. | |
| bool | setFloat (uint32_t index, const float &value) noexcept override |
| Set single-precision floating-point value. | |
| bool | setInteger (uint32_t index, const int32_t &value) noexcept override |
| Set integer value. | |
| bool | setLong (uint32_t index, const int64_t &value) noexcept override |
| Set long integer value. | |
| bool | setText (uint32_t index, const char *value) noexcept override |
| Set text value. | |
| bool | setNull (uint32_t index) noexcept override |
| Set to NULL. | |
| bool | setDateTime (uint32_t index, const sese::DateTime &value) noexcept override |
| Set to dateTime. | |
| bool | getColumnType (uint32_t index, MetadataType &type) noexcept override |
| Get result set column type. | |
| int64_t | getColumnSize (uint32_t index) noexcept override |
| Get result set column size. This interface is usually only effective when the type is binary or string, and the unit is bytes. | |
| int | getLastError () const noexcept override |
| Get the error code for the corresponding driver of the instance. | |
| const char * | getLastErrorMessage () const noexcept override |
| Get the error message for the corresponding driver of the instance. Need to check for null. | |
Public Member Functions inherited from sese::db::PreparedStatement | |
| virtual | ~PreparedStatement () noexcept=default |
| ErrorCode | getErrorCode () const |
Protected Attributes | |
| PGconn * | conn |
| std::string | stmtName |
| std::string | stmtString |
| uint32_t | count |
| Oid * | paramTypes |
| const char ** | paramValues |
| std::string * | strings |
| int | error = 0 |
| PGresult * | result |
Additional Inherited Members | |
Public Types inherited from sese::db::PreparedStatement | |
| using | Ptr = std::unique_ptr<PreparedStatement> |
PSQL prepared statement implementation.
|
explicitnoexcept |
References count().
|
overridenoexcept |
References free(), paramTypes, paramValues, result, and strings.
|
overridevirtualnoexcept |
Execute query.
| nullptr | Query failed |
Implements sese::db::PreparedStatement.
References count().
|
overridevirtualnoexcept |
Execute update.
| -1 | Update failed |
Implements sese::db::PreparedStatement.
References count().
|
nodiscardoverridevirtualnoexcept |
Get result set column size. This interface is usually only effective when the type is binary or string, and the unit is bytes.
| index | Index value |
Implements sese::db::PreparedStatement.
|
nodiscardoverridevirtualnoexcept |
Get result set column type.
| index | Index value |
| type | Column type |
Implements sese::db::PreparedStatement.
References sese::db::BOOLEAN, BOOLOID, CHAROID, sese::db::DATE, sese::db::DATE_TIME, DATEOID, sese::db::DOUBLE, sese::db::FLOAT, FLOAT4OID, FLOAT8OID, INT2OID, INT4OID, INT8OID, sese::db::INTEGER, sese::db::LONG, sese::db::SHORT, sese::db::TEXT, TEXTOID, sese::db::TIME, TIMEOID, TIMESTAMPOID, TIMESTAMPTZOID, sese::db::UNKNOWN, and VARCHAROID.
|
nodiscardoverridevirtualnoexcept |
Get the error code for the corresponding driver of the instance.
Implements sese::db::PreparedStatement.
|
nodiscardoverridevirtualnoexcept |
Get the error message for the corresponding driver of the instance. Need to check for null.
| nullptr | Failed to get error message |
Implements sese::db::PreparedStatement.
|
nodiscardoverridevirtualnoexcept |
Set to dateTime.
| index | Index |
| value | Date |
Implements sese::db::PreparedStatement.
References count(), sese::text::DateTimeFormatter::format(), and TIMESTAMPOID.
|
nodiscardoverridevirtualnoexcept |
Set double-precision floating-point value.
| index | Index |
| value | Value |
Implements sese::db::PreparedStatement.
|
nodiscardoverridevirtualnoexcept |
Set single-precision floating-point value.
| index | Index |
| value | Value |
Implements sese::db::PreparedStatement.
|
nodiscardoverridevirtualnoexcept |
Set integer value.
| index | Index |
| value | Value |
Implements sese::db::PreparedStatement.
|
nodiscardoverridevirtualnoexcept |
Set long integer value.
| index | Index |
| value | Value |
Implements sese::db::PreparedStatement.
|
nodiscardoverridevirtualnoexcept |
Set to NULL.
| index | Index |
Implements sese::db::PreparedStatement.
References count().
|
nodiscardoverridevirtualnoexcept |
Set text value.
| index | Index |
| value | Value |
Implements sese::db::PreparedStatement.
|
protected |
|
protected |
|
protected |
|
protected |
Referenced by ~PostgresPreparedStatementImpl().
|
protected |
Referenced by ~PostgresPreparedStatementImpl().
|
protected |
Referenced by ~PostgresPreparedStatementImpl().
|
protected |
|
protected |
|
protected |
Referenced by ~PostgresPreparedStatementImpl().