#include <statement.hpp>
Public Member Functions | |
statement (const statement &x)=delete | |
statement & | operator= (const statement &x)=delete |
statement ()=default | |
statement (detail::statement_impl *impl, std::shared_ptr< basic_sql_logger > sqllogger) | |
statement (detail::statement_impl *impl, T prototype, std::shared_ptr< basic_sql_logger > sqllogger) | |
statement (statement &&x) noexcept | |
statement & | operator= (statement &&x) noexcept |
void | clear () |
result< T > | execute () |
void | reset () |
std::size_t | bind (std::size_t index, T *obj) |
std::size_t | bind (std::size_t index, std::string &val, size_t size=0) |
template<class V > | |
std::size_t | bind (std::size_t index, V &val) |
std::string | str () const |
void | enable_log () |
void | disable_log () |
bool | is_log_enabled () const |
Friends | |
template<class Type > | |
class | detail::identifier_binder |
The statement class represents a prepared sql statement for a concrete object type.
T | The object type of the statement to work on |
|
default |
Creates an empty statement
|
inline |
Creates a statement initialized from the given statement implementation object holding the implementation for the selected database
impl | The statement implementation object |
sqllogger | The logger handler to write sql log messages to |
|
inline |
Creates a statement initialized from the given statement implementation object holding the implementation for the selected database
impl | The statement implementation object |
prototype | Row object containing prototype columns |
sqllogger | The logger handler to write sql log messages to |
|
inlinenoexcept |
Copy move constructor for statement
x | The statement to move from |
|
inline |
Bind single value to a specified position index of the prepared statement
The | type of the value |
val | The value to bind |
index | The index where the value is to bind |
|
inline |
Bind an object to the statement starting at the given position index.
index | The index where to start the binding |
obj | The object to bind |
|
inline |
Clear the statement
|
inline |
Disable console log of sql statements
|
inline |
Enable console log of sql statements
|
inline |
Executes the prepared statement and returns a result object. If the sql command was a select the result object holds the queried rows.
|
inline |
Returns true if logging is enabled.
|
inlinenoexcept |
Assignment move constructor for statement
x | The statement to move from |
|
inline |
Resets the statement by unbinding all bindings.
|
inline |
Returns the statement as string where the host values a shown as question marks (?)