Sese Framework
2.3.0
A cross-platform framework
|
Prepared statement object. More...
#include <PreparedStatement.h>
Public Types | |
using | Ptr = std::unique_ptr<PreparedStatement> |
Public Member Functions | |
virtual | ~PreparedStatement () noexcept=default |
virtual ResultSet::Ptr | executeQuery () noexcept=0 |
Execute query. | |
virtual int64_t | executeUpdate () noexcept=0 |
Execute update. | |
virtual bool | setDouble (uint32_t index, const double &value) noexcept=0 |
Set double-precision floating-point value. | |
virtual bool | setFloat (uint32_t index, const float &value) noexcept=0 |
Set single-precision floating-point value. | |
virtual bool | setInteger (uint32_t index, const int32_t &value) noexcept=0 |
Set integer value. | |
virtual bool | setLong (uint32_t index, const int64_t &value) noexcept=0 |
Set long integer value. | |
virtual bool | setText (uint32_t index, const char *value) noexcept=0 |
Set text value. | |
virtual bool | setNull (uint32_t index) noexcept=0 |
Set to NULL. | |
virtual bool | setDateTime (uint32_t index, const sese::DateTime &value) noexcept=0 |
Set to dateTime. | |
virtual bool | getColumnType (uint32_t index, MetadataType &type) noexcept=0 |
Get result set column type. | |
virtual int64_t | getColumnSize (uint32_t index) noexcept=0 |
Get result set column size. This interface is usually only effective when the type is binary or string, and the unit is bytes. | |
virtual int | getLastError () const noexcept=0 |
Get the error code for the corresponding driver of the instance. | |
virtual const char * | getLastErrorMessage () const noexcept=0 |
Get the error message for the corresponding driver of the instance. Need to check for null. | |
ErrorCode | getErrorCode () const |
Prepared statement object.
using sese::db::PreparedStatement::Ptr = std::unique_ptr<PreparedStatement> |
|
virtualdefaultnoexcept |
|
pure virtualnoexcept |
Execute query.
nullptr | Query failed |
Implemented in sese::db::impl::MariaPreparedStatementImpl, sese::db::impl::PostgresPreparedStatementImpl, and sese::db::impl::SqlitePreparedStatementImpl.
|
pure virtualnoexcept |
Execute update.
-1 | Update failed |
Implemented in sese::db::impl::MariaPreparedStatementImpl, sese::db::impl::PostgresPreparedStatementImpl, and sese::db::impl::SqlitePreparedStatementImpl.
|
pure virtualnoexcept |
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 |
Implemented in sese::db::impl::MariaPreparedStatementImpl, sese::db::impl::PostgresPreparedStatementImpl, and sese::db::impl::SqlitePreparedStatementImpl.
|
pure virtualnoexcept |
Get result set column type.
index | Index value |
type | Column type |
Implemented in sese::db::impl::MariaPreparedStatementImpl, sese::db::impl::PostgresPreparedStatementImpl, and sese::db::impl::SqlitePreparedStatementImpl.
|
inline |
References getLastError(), and getLastErrorMessage().
|
nodiscardpure virtualnoexcept |
Get the error code for the corresponding driver of the instance.
Implemented in sese::db::impl::MariaPreparedStatementImpl, sese::db::impl::PostgresPreparedStatementImpl, and sese::db::impl::SqlitePreparedStatementImpl.
Referenced by getErrorCode().
|
nodiscardpure virtualnoexcept |
Get the error message for the corresponding driver of the instance. Need to check for null.
nullptr | Failed to get error message |
Implemented in sese::db::impl::MariaPreparedStatementImpl, sese::db::impl::PostgresPreparedStatementImpl, and sese::db::impl::SqlitePreparedStatementImpl.
Referenced by getErrorCode().
|
pure virtualnoexcept |
Set to dateTime.
index | Index |
value | Date |
Implemented in sese::db::impl::MariaPreparedStatementImpl, sese::db::impl::PostgresPreparedStatementImpl, and sese::db::impl::SqlitePreparedStatementImpl.
|
pure virtualnoexcept |
Set double-precision floating-point value.
index | Index |
value | Value |
Implemented in sese::db::impl::MariaPreparedStatementImpl, sese::db::impl::PostgresPreparedStatementImpl, and sese::db::impl::SqlitePreparedStatementImpl.
|
pure virtualnoexcept |
Set single-precision floating-point value.
index | Index |
value | Value |
Implemented in sese::db::impl::MariaPreparedStatementImpl, sese::db::impl::PostgresPreparedStatementImpl, and sese::db::impl::SqlitePreparedStatementImpl.
|
pure virtualnoexcept |
Set integer value.
index | Index |
value | Value |
Implemented in sese::db::impl::MariaPreparedStatementImpl, sese::db::impl::PostgresPreparedStatementImpl, and sese::db::impl::SqlitePreparedStatementImpl.
|
pure virtualnoexcept |
Set long integer value.
index | Index |
value | Value |
Implemented in sese::db::impl::MariaPreparedStatementImpl, sese::db::impl::PostgresPreparedStatementImpl, and sese::db::impl::SqlitePreparedStatementImpl.
|
pure virtualnoexcept |
Set to NULL.
index | Index |
Implemented in sese::db::impl::MariaPreparedStatementImpl, sese::db::impl::PostgresPreparedStatementImpl, and sese::db::impl::SqlitePreparedStatementImpl.
|
pure virtualnoexcept |
Set text value.
index | Index |
value | Value |
Implemented in sese::db::impl::MariaPreparedStatementImpl, sese::db::impl::PostgresPreparedStatementImpl, and sese::db::impl::SqlitePreparedStatementImpl.