A sqlite statement.
More...
#include <sqlitestatement.h>
◆ SqliteStatement() [1/3]
Nickvision::Database::SqliteStatement::SqliteStatement |
( |
sqlite3 * | database, |
|
|
const std::string & | command ) |
Constructs a SqliteStatement.
- Parameters
-
database | The sqlite3 database |
command | The sql command to set to the statement |
- Exceptions
-
std::runtime_error | Thrown if error in executing sql statement |
◆ SqliteStatement() [2/3]
Nickvision::Database::SqliteStatement::SqliteStatement |
( |
const SqliteStatement & | | ) |
|
|
delete |
◆ SqliteStatement() [3/3]
Nickvision::Database::SqliteStatement::SqliteStatement |
( |
SqliteStatement && | other | ) |
|
|
noexcept |
◆ ~SqliteStatement()
Nickvision::Database::SqliteStatement::~SqliteStatement |
( |
| ) |
|
|
noexcept |
◆ bind()
template<SupportedSqliteValue T>
bool Nickvision::Database::SqliteStatement::bind |
( |
int | index, |
|
|
T | value ) |
|
inlinenoexcept |
Binds a value to a sqlite parameter.
- Template Parameters
-
T | The type of the value to bind |
- Parameters
-
index | The index of the parameter |
value | The value to bind |
- Returns
- True if bind was successful, else false
◆ getColumn()
template<SupportedSqliteValue T>
T Nickvision::Database::SqliteStatement::getColumn |
( |
int | index | ) |
|
|
inlinenoexcept |
Gets the sqlite column value as a specific type.
- Template Parameters
-
T | The type to get the sqlite column value as (Can be: int, std::int64_t, double, bool, std::string) |
- Returns
- The sqlite column value as the specified type
-
A default value if the sqlite column value is not of the specified type
◆ operator bool()
Nickvision::Database::SqliteStatement::operator bool |
( |
| ) |
const |
|
noexcept |
Gets whether or not the object is valid or not.
- Returns
- True if valid, else false
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ step()
The documentation for this class was generated from the following file: