ledger-core
Public Member Functions | List of all members
ledger::core::api::DatabaseStatement Class Referenceabstract

#include <DatabaseStatement.hpp>

+ Inheritance diagram for ledger::core::api::DatabaseStatement:

Public Member Functions

virtual void bindShort (int32_t pos, int16_t value)=0
 
virtual void bindInt (int32_t pos, int32_t value)=0
 
virtual void bindLong (int32_t pos, int64_t value)=0
 
virtual void bindFloat (int32_t pos, float value)=0
 
virtual void bindDouble (int32_t pos, double value)=0
 
virtual void bindString (int32_t pos, const std::string &value)=0
 
virtual void bindBlob (int32_t pos, const std::shared_ptr< DatabaseBlob > &value)=0
 
virtual void bindNull (int32_t pos)=0
 
virtual std::shared_ptr< DatabaseColumndescribeColumn (int32_t colNum)=0
 
virtual int32_t getColumnCount ()=0
 
virtual std::shared_ptr< DatabaseResultSetexecute ()=0
 
virtual void reset ()=0
 
virtual void close ()=0
 

Detailed Description

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.

Member Function Documentation

◆ 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
posThe position of the parameter in the query
valueThe 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
posThe position of the parameter in the query
valueThe 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
posThe position of the parameter in the query
valueThe 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
posThe position of the parameter in the query
valueThe 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
posThe position of the parameter in the query
valueThe 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
posThe position of the parameter in the query
valueThe 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
posThe position of the parameter in the query
valueThe 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
posThe position of the parameter in the query
valueThe 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: