dodo  0.0.1
A C++ library to create containerized Linux services
dodo::persist::sqlite::Statement Class Reference

Generic SQL Statement. More...

#include <sqlite.hpp>

Inheritance diagram for dodo::persist::sqlite::Statement:
Collaboration diagram for dodo::persist::sqlite::Statement:

Public Member Functions

 Statement (const Database &db)
 Constructor. More...
 
virtual ~Statement ()
 Destructor. More...
 
void close ()
 A statement handle can be explicitly closed without deleting the Statement object itself. More...
 
void prepare (const std::string &sql)
 Prepare a SQL statement. More...
 
void reset (bool clear=true)
 Reset a SQL statement for re-execute or even re-prepare. More...
 

Protected Attributes

sqlite3 * database_
 database handle on which the stmt_ is created. More...
 
sqlite3_stmt * stmt_
 statement handle. More...
 

Detailed Description

Generic SQL Statement.

Definition at line 210 of file sqlite.hpp.

Constructor & Destructor Documentation

◆ Statement()

dodo::persist::sqlite::Statement::Statement ( const Database db)

Constructor.

Parameters
dbThe database context of the statement.

Definition at line 348 of file sqlite.cpp.

References database_, dodo::persist::sqlite::Database::getDB(), and stmt_.

Here is the call graph for this function:

◆ ~Statement()

dodo::persist::sqlite::Statement::~Statement ( )
virtual

Destructor.

Virtual so that this destructor will be called when descendants are deleted.

Definition at line 353 of file sqlite.cpp.

References close(), and stmt_.

Here is the call graph for this function:

Member Function Documentation

◆ close()

void dodo::persist::sqlite::Statement::close ( )

A statement handle can be explicitly closed without deleting the Statement object itself.

This frees the resources in SQLite, . it's allowed to call prepare() again.

Definition at line 381 of file sqlite.cpp.

References database_, stmt_, and throw_Exception.

Referenced by prepare(), and ~Statement().

Here is the caller graph for this function:

◆ prepare()

◆ reset()

void dodo::persist::sqlite::Statement::reset ( bool  clear = true)

Reset a SQL statement for re-execute or even re-prepare.

Parameters
clearIf true (default), unbind the bind variables. If the statement is going to be re-executed, new bind calls must be made. If the satemetn is going to be re-executed with the same bind values, cler can be set to false and no re-binding is required.

Definition at line 368 of file sqlite.cpp.

References database_, stmt_, and throw_Exception.

Referenced by dodo::persist::KVStore::deleteKey(), dodo::persist::KVStore::exists(), dodo::persist::KVStore::filterKeys(), dodo::persist::KVStore::getMetaData(), dodo::persist::KVStore::getValue(), dodo::persist::KVStore::insertKey(), and dodo::persist::KVStore::setKey().

Here is the caller graph for this function:

Field Documentation

◆ database_

sqlite3* dodo::persist::sqlite::Statement::database_
protected

◆ stmt_


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