Implements basic parsing of the Wolframe SQL statement with placeholders, derived classes can steer how the SQL string is converted to native format.
More...
#include <baseStatement.hpp>
|
| BaseStatement () |
|
| BaseStatement (const BaseStatement &o) |
|
| BaseStatement (const std::string &stmtStr) |
|
virtual void | init (const std::string &stmtStr) |
| Set new SQL statement. More...
|
|
virtual void | clear () |
| Clear current statement. More...
|
|
virtual void | substitute (bool checkForMissingPlaceholders=true) |
| Trigger substitution (nativeSQL is valid after this call and not before!) More...
|
|
virtual void | bind (const unsigned int idx, const types::Variant &value) |
| Binds parameter at position idx with variant data in the format with Wolframe placeholders. More...
|
|
virtual const std::string | originalSQL () const |
| Returns the SQL statement as passed down to the database layer. More...
|
|
virtual const std::string | nativeSQL () const |
| Returns the SQL statement with the native database placeholders or the data filled in (this is up to the derived classes). More...
|
|
virtual | ~Statement () |
|
virtual const std::string | replace (const unsigned int idx) const =0 |
| Funtion called when the placeholder should be put into the final string (this is either for subsituting data or rewrite placeholders to native syntax) More...
|
|
|
typedef std::pair< unsigned
int, std::string > | Element |
|
Implements basic parsing of the Wolframe SQL statement with placeholders, derived classes can steer how the SQL string is converted to native format.
_Wolframe::db::BaseStatement::BaseStatement |
( |
| ) |
|
_Wolframe::db::BaseStatement::BaseStatement |
( |
const BaseStatement & |
o | ) |
|
_Wolframe::db::BaseStatement::BaseStatement |
( |
const std::string & |
stmtStr | ) |
|
|
explicit |
virtual void _Wolframe::db::BaseStatement::bind |
( |
const unsigned int |
idx, |
|
|
const types::Variant & |
arg |
|
) |
| |
|
virtual |
virtual void _Wolframe::db::BaseStatement::clear |
( |
| ) |
|
|
virtual |
virtual void _Wolframe::db::BaseStatement::init |
( |
const std::string & |
stmtStr | ) |
|
|
virtual |
virtual const std::string _Wolframe::db::BaseStatement::nativeSQL |
( |
| ) |
const |
|
virtual |
Returns the SQL statement with the native database placeholders or the data filled in (this is up to the derived classes).
Implements _Wolframe::db::Statement.
virtual const std::string _Wolframe::db::BaseStatement::originalSQL |
( |
| ) |
const |
|
virtual |
void _Wolframe::db::BaseStatement::parse |
( |
| ) |
|
|
private |
virtual void _Wolframe::db::BaseStatement::substitute |
( |
bool |
checkForMissingPlaceholders = true | ) |
|
|
virtual |
Trigger substitution (nativeSQL is valid after this call and not before!)
- Parameters
-
[in] | checkForMissingPlaceholders | whether the function should already check the validity and cardinality of the placeholders in the SQL statement |
Implements _Wolframe::db::Statement.
std::vector<Element> _Wolframe::db::BaseStatement::m_data |
|
private |
Remembers positions and parts of SQL snippets.
unsigned int _Wolframe::db::BaseStatement::m_maxParam |
|
protected |
The maximum number of parsed placeholders so far.
std::string _Wolframe::db::BaseStatement::m_nativeStmt |
|
private |
The SQL statement as understood by the database.
std::bitset<MaxNofParams> _Wolframe::db::BaseStatement::m_setIdx |
|
private |
Remembers the placeholders bound to actual data.
std::string _Wolframe::db::BaseStatement::m_stmtStr |
|
protected |
std::bitset<MaxNofParams> _Wolframe::db::BaseStatement::m_usedIdx |
|
private |
Remembers the indexes used in the SQL statement.
The documentation for this class was generated from the following file: