#include <DatabaseStatement.hpp>
A wrapper object around prepared SQL statements. lib-ledger-core will use placeholders when it needs to pass parameters to a query. It will then bind each parameter at a given position to a given value.
◆ bindBlob()
virtual void ledger::core::api::DatabaseStatement::bindBlob |
( |
int32_t |
pos, |
|
|
const std::shared_ptr< DatabaseBlob > & |
value |
|
) |
| |
|
pure virtual |
Bind the designated parameter to the given BLOB.
- Parameters
-
pos | The position of the parameter in the query |
value | The value to bind |
◆ bindDouble()
virtual void ledger::core::api::DatabaseStatement::bindDouble |
( |
int32_t |
pos, |
|
|
double |
value |
|
) |
| |
|
pure virtual |
Bind the designated parameter to the given 64bit floating point number value.
- Parameters
-
pos | The position of the parameter in the query |
value | The value to bind |
Implemented in Statement.
◆ bindFloat()
virtual void ledger::core::api::DatabaseStatement::bindFloat |
( |
int32_t |
pos, |
|
|
float |
value |
|
) |
| |
|
pure virtual |
Bind the designated parameter to the given 32bit floating point number value.
- Parameters
-
pos | The position of the parameter in the query |
value | The value to bind |
Implemented in Statement.
◆ bindInt()
virtual void ledger::core::api::DatabaseStatement::bindInt |
( |
int32_t |
pos, |
|
|
int32_t |
value |
|
) |
| |
|
pure virtual |
Bind the designated parameter to the given 32bit integer value.
- Parameters
-
pos | The position of the parameter in the query |
value | The value to bind |
Implemented in Statement.
◆ bindLong()
virtual void ledger::core::api::DatabaseStatement::bindLong |
( |
int32_t |
pos, |
|
|
int64_t |
value |
|
) |
| |
|
pure virtual |
Bind the designated parameter to the given 64bit integer value.
- Parameters
-
pos | The position of the parameter in the query |
value | The value to bind |
Implemented in Statement.
◆ bindNull()
virtual void ledger::core::api::DatabaseStatement::bindNull |
( |
int32_t |
pos | ) |
|
|
pure virtual |
Bind the designated parameter to the NULL value in SQL.
- Parameters
-
pos | The position of the parameter in the query |
value | The value to bind |
Implemented in Statement.
◆ bindShort()
virtual void ledger::core::api::DatabaseStatement::bindShort |
( |
int32_t |
pos, |
|
|
int16_t |
value |
|
) |
| |
|
pure virtual |
Bind the designated parameter to the given 16bit integer value.
- Parameters
-
pos | The position of the parameter in the query |
value | The value to bind |
Implemented in Statement.
◆ bindString()
virtual void ledger::core::api::DatabaseStatement::bindString |
( |
int32_t |
pos, |
|
|
const std::string & |
value |
|
) |
| |
|
pure virtual |
Bind the designated parameter to the given string.
- Parameters
-
pos | The position of the parameter in the query |
value | The value to bind |
Implemented in Statement.
◆ close()
virtual void ledger::core::api::DatabaseStatement::close |
( |
| ) |
|
|
pure virtual |
Close the statement and release all allocated resources. The statement shouldn't be used after this call.
Implemented in Statement.
◆ describeColumn()
virtual std::shared_ptr<DatabaseColumn> ledger::core::api::DatabaseStatement::describeColumn |
( |
int32_t |
colNum | ) |
|
|
pure virtual |
Describe the metadata attached to the designated column (e.g. data type, column name...)
- Returns
- Column metadata descriptor
Implemented in Statement.
◆ execute()
virtual std::shared_ptr<DatabaseResultSet> ledger::core::api::DatabaseStatement::execute |
( |
| ) |
|
|
pure virtual |
Execute the statement with the past bound values.
- Returns
- The result of the execution of the statement on the database.
Implemented in Statement.
◆ getColumnCount()
virtual int32_t ledger::core::api::DatabaseStatement::getColumnCount |
( |
| ) |
|
|
pure virtual |
Get the number of column that will be available into the result row (e.g. "SELECT name, age FROM USERS" would return 2).
- Returns
- The number of the columns available in the result
Implemented in Statement.
◆ reset()
virtual void ledger::core::api::DatabaseStatement::reset |
( |
| ) |
|
|
pure virtual |
Reset all bindings. This call is used before reusing a statement instance in order to repeat it multiple time.
Implemented in Statement.
The documentation for this class was generated from the following file: