SQL prepared statement.
More...
#include <preparedStatement.hpp>
|
| PreparedStatement () noexcept |
|
virtual | ~PreparedStatement () noexcept |
|
virtual ResultSet * | executeQuery ()=0 |
|
virtual uint64_t | executeUpdate ()=0 |
|
void | set (std::size_t idx, int16_t value) |
|
void | set (std::size_t idx, uint16_t value) |
|
void | set (std::size_t idx, int32_t value) |
|
void | set (std::size_t idx, uint32_t value) |
|
void | set (std::size_t idx, int64_t value) |
|
void | set (std::size_t idx, uint64_t value) |
|
void | set (std::size_t idx, const std::string &value) |
|
void | set (std::size_t idx, const char *const value) |
|
virtual void | set (std::size_t idx, const anch::sql::Date &value) |
|
virtual void | set (std::size_t idx, const anch::sql::Time &value) |
|
virtual void | set (std::size_t idx, const anch::sql::Timestamp &value) |
|
SQL prepared statement.
Virtual class for SQL prepared statement management.
- Author
- Vincent Lachenal
- Since
- 0.1
◆ PreparedStatement()
anch::sql::PreparedStatement::PreparedStatement |
( |
| ) |
|
|
noexcept |
◆ ~PreparedStatement()
virtual anch::sql::PreparedStatement::~PreparedStatement |
( |
| ) |
|
|
virtualnoexcept |
◆ checkIndex()
void anch::sql::PreparedStatement::checkIndex |
( |
std::size_t | index | ) |
const |
|
inlineprotected |
Check index value
- Parameters
-
- Exceptions
-
◆ executeQuery()
virtual ResultSet * anch::sql::PreparedStatement::executeQuery |
( |
| ) |
|
|
pure virtual |
◆ executeUpdate()
virtual uint64_t anch::sql::PreparedStatement::executeUpdate |
( |
| ) |
|
|
pure virtual |
◆ getPlaceholders()
std::set< std::size_t > anch::sql::PreparedStatement::getPlaceholders |
( |
const std::string & | query | ) |
const |
|
protected |
Retrieve placeholders positions ('?') in SQL query
- Parameters
-
- Returns
- the placeholders' position
◆ set() [1/11]
virtual void anch::sql::PreparedStatement::set |
( |
std::size_t | idx, |
|
|
const anch::sql::Date & | value ) |
|
virtual |
Bind SQL date value to prepared statement
- Parameters
-
idx | the prepared statement index parameter |
value | the value to bind |
- Exceptions
-
◆ set() [2/11]
virtual void anch::sql::PreparedStatement::set |
( |
std::size_t | idx, |
|
|
const anch::sql::Time & | value ) |
|
virtual |
Bind SQL time value to prepared statement
- Parameters
-
idx | the prepared statement index parameter |
value | the value to bind |
- Exceptions
-
◆ set() [3/11]
virtual void anch::sql::PreparedStatement::set |
( |
std::size_t | idx, |
|
|
const anch::sql::Timestamp & | value ) |
|
virtual |
Bind SQL timestamp value to prepared statement
- Parameters
-
idx | the prepared statement index parameter |
value | the value to bind |
- Exceptions
-
◆ set() [4/11]
void anch::sql::PreparedStatement::set |
( |
std::size_t | idx, |
|
|
const char *const | value ) |
Bind character array value to prepared statement
- Parameters
-
idx | the prepared statement index parameter |
value | the value to bind |
- Exceptions
-
◆ set() [5/11]
void anch::sql::PreparedStatement::set |
( |
std::size_t | idx, |
|
|
const std::string & | value ) |
Bind string value to prepared statement
- Parameters
-
idx | the prepared statement index parameter |
value | the value to bind |
- Exceptions
-
◆ set() [6/11]
void anch::sql::PreparedStatement::set |
( |
std::size_t | idx, |
|
|
int16_t | value ) |
Bind 16 bits signed integer value to prepared statement
- Parameters
-
idx | the prepared statement index parameter |
value | the value to bind |
- Exceptions
-
◆ set() [7/11]
void anch::sql::PreparedStatement::set |
( |
std::size_t | idx, |
|
|
int32_t | value ) |
Bind 32 bits signed integer value to prepared statement
- Parameters
-
idx | the prepared statement index parameter |
value | the value to bind |
- Exceptions
-
◆ set() [8/11]
void anch::sql::PreparedStatement::set |
( |
std::size_t | idx, |
|
|
int64_t | value ) |
Bind 64 bits signed integer value to prepared statement
- Parameters
-
idx | the prepared statement index parameter |
value | the value to bind |
- Exceptions
-
◆ set() [9/11]
void anch::sql::PreparedStatement::set |
( |
std::size_t | idx, |
|
|
uint16_t | value ) |
Bind 16 bits unsigned integer value to prepared statement
- Parameters
-
idx | the prepared statement index parameter |
value | the value to bind |
- Exceptions
-
◆ set() [10/11]
void anch::sql::PreparedStatement::set |
( |
std::size_t | idx, |
|
|
uint32_t | value ) |
Bind 32 bits unsigned integer value to prepared statement
- Parameters
-
idx | the prepared statement index parameter |
value | the value to bind |
- Exceptions
-
◆ set() [11/11]
void anch::sql::PreparedStatement::set |
( |
std::size_t | idx, |
|
|
uint64_t | value ) |
Bind 64 bits unsigned integer value to prepared statement
- Parameters
-
idx | the prepared statement index parameter |
value | the value to bind |
- Exceptions
-
◆ _nbPlaceholders
std::size_t anch::sql::PreparedStatement::_nbPlaceholders |
|
protected |
Number of placeholders in SQL query
◆ _values
std::map<std::size_t,std::string> anch::sql::PreparedStatement::_values |
|
protected |
The documentation for this class was generated from the following file: