ledger-core
Public Member Functions | List of all members
Statement Class Reference
+ Inheritance diagram for Statement:
+ Collaboration diagram for Statement:

Public Member Functions

 Statement (sqlite3 *db, const std::string &query)
 
void bindShort (int32_t pos, int16_t value) override
 
void bindInt (int32_t pos, int32_t value) override
 
void bindLong (int32_t pos, int64_t value) override
 
void bindFloat (int32_t pos, float value) override
 
void bindDouble (int32_t pos, double value) override
 
void bindString (int32_t pos, const std::string &value) override
 
void bindBlob (int32_t pos, const std::shared_ptr< api::DatabaseBlob > &value) override
 
void bindNull (int32_t pos) override
 
void reset () override
 
std::shared_ptr< api::DatabaseColumndescribeColumn (int32_t colNum) override
 
int32_t getColumnCount () override
 
std::shared_ptr< api::DatabaseResultSetexecute () override
 
void close () override
 
- Public Member Functions inherited from ledger::core::api::DatabaseStatement
virtual void bindBlob (int32_t pos, const std::shared_ptr< DatabaseBlob > &value)=0
 

Member Function Documentation

◆ bindDouble()

void Statement::bindDouble ( int32_t  pos,
double  value 
)
inlineoverridevirtual

Bind the designated parameter to the given 64bit floating point number value.

Parameters
posThe position of the parameter in the query
valueThe value to bind

Implements ledger::core::api::DatabaseStatement.

◆ bindFloat()

void Statement::bindFloat ( int32_t  pos,
float  value 
)
inlineoverridevirtual

Bind the designated parameter to the given 32bit floating point number value.

Parameters
posThe position of the parameter in the query
valueThe value to bind

Implements ledger::core::api::DatabaseStatement.

◆ bindInt()

void Statement::bindInt ( int32_t  pos,
int32_t  value 
)
inlineoverridevirtual

Bind the designated parameter to the given 32bit integer value.

Parameters
posThe position of the parameter in the query
valueThe value to bind

Implements ledger::core::api::DatabaseStatement.

◆ bindLong()

void Statement::bindLong ( int32_t  pos,
int64_t  value 
)
inlineoverridevirtual

Bind the designated parameter to the given 64bit integer value.

Parameters
posThe position of the parameter in the query
valueThe value to bind

Implements ledger::core::api::DatabaseStatement.

◆ bindNull()

void Statement::bindNull ( int32_t  pos)
inlineoverridevirtual

Bind the designated parameter to the NULL value in SQL.

Parameters
posThe position of the parameter in the query
valueThe value to bind

Implements ledger::core::api::DatabaseStatement.

◆ bindShort()

void Statement::bindShort ( int32_t  pos,
int16_t  value 
)
inlineoverridevirtual

Bind the designated parameter to the given 16bit integer value.

Parameters
posThe position of the parameter in the query
valueThe value to bind

Implements ledger::core::api::DatabaseStatement.

◆ bindString()

void Statement::bindString ( int32_t  pos,
const std::string &  value 
)
inlineoverridevirtual

Bind the designated parameter to the given string.

Parameters
posThe position of the parameter in the query
valueThe value to bind

Implements ledger::core::api::DatabaseStatement.

◆ close()

void Statement::close ( )
inlineoverridevirtual

Close the statement and release all allocated resources. The statement shouldn't be used after this call.

Implements ledger::core::api::DatabaseStatement.

◆ describeColumn()

std::shared_ptr<api::DatabaseColumn> Statement::describeColumn ( int32_t  colNum)
inlineoverridevirtual

Describe the metadata attached to the designated column (e.g. data type, column name...)

Returns
Column metadata descriptor

Implements ledger::core::api::DatabaseStatement.

◆ execute()

std::shared_ptr<api::DatabaseResultSet> Statement::execute ( )
inlineoverridevirtual

Execute the statement with the past bound values.

Returns
The result of the execution of the statement on the database.

Implements ledger::core::api::DatabaseStatement.

◆ getColumnCount()

int32_t Statement::getColumnCount ( )
inlineoverridevirtual

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

Implements ledger::core::api::DatabaseStatement.

◆ reset()

void Statement::reset ( )
inlineoverridevirtual

Reset all bindings. This call is used before reusing a statement instance in order to repeat it multiple time.

Implements ledger::core::api::DatabaseStatement.


The documentation for this class was generated from the following file: