sqlite::command Struct Reference
command is the base class of all sql command classes An object of this class is not copyable
More...
#include <command.hpp>
List of all members.
Public Member Functions |
| command (connection &con, std::string const &sql) |
| command constructor
|
virtual | ~command () |
| command destructor
|
void | clear () |
| clear is used if you'd like to reuse a command object
|
bool | emit () |
| emit executes the sql command If you have used placeholders you must have replaced all placeholders
|
bool | operator() () |
| works exactly like the method command::emit
|
void | bind (int idx) |
| binds NULL to the given 1 based index
|
void | bind (int idx, int v) |
| binds the 32-Bit integer v to the given 1 based index
|
void | bind (int idx, boost::int64_t v) |
| binds the 64-Bit integer v to the given 1 based index
|
void | bind (int idx, double v) |
| binds the double v to the given 1 based index
|
void | bind (int idx, std::string const &v) |
| binds the text/string v to the given 1 based index
|
void | bind (int idx, void const *buf, size_t buf_size) |
| binds the binary/blob buf to the given 1 based index
|
void | bind (int idx, std::vector< unsigned char > const &v) |
| binds the binary/blob v to the given 1 based index
|
command & | operator% (null_type const &p) |
| replacement for void command::bind(int idx); To use this operator% you have to use the global object nil Indexes are given automatically first call uses 1 as index, second 2 and so on
|
command & | operator% (int p) |
| replacement for void command::bind(int idx,int); Indexes are given automatically first call uses 1 as index, second 2 and so on
|
command & | operator% (boost::int64_t p) |
| replacement for void command::bind(int idx,boost::int64_t); Indexes are given automatically first call uses 1 as index, second 2 and so on
|
command & | operator% (double p) |
| replacement for void command::bind(int idx,double); Indexes are given automatically first call uses 1 as index, second 2 and so on
|
command & | operator% (std::string const &p) |
| replacement for void command::bind(int idx,std::string const&); Indexes are given automatically first call uses 1 as index, second 2 and so on
|
command & | operator% (std::vector< unsigned char > const &p) |
| replacement for void command::bind(int idx,std::vector<unsigned char> const&); Indexes are given automatically first call uses 1 as index, second 2 and so on
|
Protected Member Functions |
void | access_check () |
bool | step () |
struct sqlite3 * | get_handle () |
Protected Attributes |
sqlite3_stmt * | stmt |
Private Member Functions |
void | prepare () |
void | finalize () |
Private Attributes |
connection & | m_con |
std::string | m_sql |
int | last_arg_idx |
Detailed Description
command is the base class of all sql command classes An object of this class is not copyable
Definition at line 57 of file command.hpp.
Constructor & Destructor Documentation
sqlite::command::command |
( |
connection & |
con, |
|
|
std::string const & |
sql | |
|
) |
| | |
command constructor
- Parameters:
-
| con | takes a reference to the database connection type connection |
| sql | is the SQL string. The sql string can contain placeholder the question mark '?' is used as placeholder the command::bind methods or command::operator% syntax must be used to replace the placeholders |
virtual sqlite::command::~command |
( |
|
) |
[virtual] |
Member Function Documentation
void sqlite::command::access_check |
( |
|
) |
[protected] |
void sqlite::command::bind |
( |
int |
idx, |
|
|
std::vector< unsigned char > const & |
v | |
|
) |
| | |
binds the binary/blob v to the given 1 based index
- Parameters:
-
| idx | 1 based index of the placeholder within the sql statement |
| v | binary/blob buffer which should replace the placeholder v is a std::vector<unsigned char> const & |
void sqlite::command::bind |
( |
int |
idx, |
|
|
void const * |
buf, |
|
|
size_t |
buf_size | |
|
) |
| | |
binds the binary/blob buf to the given 1 based index
- Parameters:
-
| idx | 1 based index of the placeholder within the sql statement |
| buf | binary/blob buf which should replace the placeholder |
| buf_size | size in bytes of the binary buffer |
void sqlite::command::bind |
( |
int |
idx, |
|
|
std::string const & |
v | |
|
) |
| | |
binds the text/string v to the given 1 based index
- Parameters:
-
| idx | 1 based index of the placeholder within the sql statement |
| v | text/string value which should replace the placeholder |
void sqlite::command::bind |
( |
int |
idx, |
|
|
double |
v | |
|
) |
| | |
binds the double v to the given 1 based index
- Parameters:
-
| idx | 1 based index of the placeholder within the sql statement |
| v | double value which should replace the placeholder |
void sqlite::command::bind |
( |
int |
idx, |
|
|
boost::int64_t |
v | |
|
) |
| | |
binds the 64-Bit integer v to the given 1 based index
- Parameters:
-
| idx | 1 based index of the placeholder within the sql statement |
| v | 64-Bit integer value which should replace the placeholder |
void sqlite::command::bind |
( |
int |
idx, |
|
|
int |
v | |
|
) |
| | |
binds the 32-Bit integer v to the given 1 based index
- Parameters:
-
| idx | 1 based index of the placeholder within the sql statement |
| v | 32-Bit integer value which should replace the placeholder |
void sqlite::command::bind |
( |
int |
idx |
) |
|
binds NULL to the given 1 based index
void sqlite::command::clear |
( |
|
) |
|
clear is used if you'd like to reuse a command object
bool sqlite::command::emit |
( |
|
) |
|
emit executes the sql command If you have used placeholders you must have replaced all placeholders
void sqlite::command::finalize |
( |
|
) |
[private] |
struct sqlite3* sqlite::command::get_handle |
( |
|
) |
[read, protected] |
command& sqlite::command::operator% |
( |
std::vector< unsigned char > const & |
p |
) |
|
command& sqlite::command::operator% |
( |
std::string const & |
p |
) |
|
replacement for void command::bind(int idx,std::string const&); Indexes are given automatically first call uses 1 as index, second 2 and so on
- Parameters:
-
| p | should be a Zero Terminated C-style string (char * or char const*), or a std::string object, |
command& sqlite::command::operator% |
( |
double |
p |
) |
|
command& sqlite::command::operator% |
( |
boost::int64_t |
p |
) |
|
command& sqlite::command::operator% |
( |
int |
p |
) |
|
replacement for void command::bind(int idx,int); Indexes are given automatically first call uses 1 as index, second 2 and so on
- Parameters:
-
| p | should be a 32-Bit integer |
replacement for void command::bind(int idx); To use this operator% you have to use the global object nil Indexes are given automatically first call uses 1 as index, second 2 and so on
- Parameters:
-
bool sqlite::command::operator() |
( |
|
) |
|
void sqlite::command::prepare |
( |
|
) |
[private] |
bool sqlite::command::step |
( |
|
) |
[protected] |
Member Data Documentation
The documentation for this struct was generated from the following file: