SQLite3 result set implementation.
More...
#include <sqlite3ResultSet.hpp>
|
| SQLite3ResultSet (sqlite3_stmt *stmt, bool prepared=false) noexcept |
|
virtual | ~SQLite3ResultSet () |
|
virtual bool | next () |
|
| ResultSet () noexcept |
|
virtual | ~ResultSet () noexcept |
|
template<typename T> |
bool | get (std::size_t idx, T &out) |
|
template<typename T> |
bool | get (const std::string field, T &out) |
|
template<typename T> |
std::optional< T > | get (std::size_t idx) |
|
template<typename T> |
const std::optional< T > | get (const std::string field) |
|
|
std::map< std::string, std::size_t > | _fields |
|
SQLite3 result set implementation.
Implements ResultSet for SQLite3
- Author
- Vincent Lachenal
- Since
- 0.1
◆ SQLite3ResultSet()
anch::sql::SQLite3ResultSet::SQLite3ResultSet |
( |
sqlite3_stmt * | stmt, |
|
|
bool | prepared = false ) |
|
noexcept |
SQLite3ResultSet constructor
- Parameters
-
stmt | the SQLite3 statement |
prepared | prepared statement or not (default to not) |
◆ ~SQLite3ResultSet()
virtual anch::sql::SQLite3ResultSet::~SQLite3ResultSet |
( |
| ) |
|
|
virtual |
◆ getDateFormatter()
◆ getTimeFormatter()
◆ getTimestampFormatter()
Retrieve SQL timestamp formatter
- Returns
- the SQL timestamp formatter
Implements anch::sql::ResultSet.
◆ getValue() [1/2]
virtual std::optional< std::string > anch::sql::SQLite3ResultSet::getValue |
( |
std::size_t | idx | ) |
|
|
overrideprotectedvirtual |
Retrieve string value from result set according to SQL database engine.
- Parameters
-
- Returns
- the result
- Exceptions
-
Implements anch::sql::ResultSet.
◆ getValue() [2/2]
virtual bool anch::sql::SQLite3ResultSet::getValue |
( |
std::size_t | idx, |
|
|
std::string & | out ) |
|
overrideprotectedvirtual |
Retrieve string value from result set according to SQL database engine.
- Parameters
-
idx | the field index |
out | the result |
- Exceptions
-
Implements anch::sql::ResultSet.
◆ next()
virtual bool anch::sql::SQLite3ResultSet::next |
( |
| ) |
|
|
virtual |
Fetch next row in SQL result set.
- Returns
true
if next row exists, false
otherwise
- Exceptions
-
Implements anch::sql::ResultSet.
The documentation for this class was generated from the following file: