VSQLite++  0.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends
Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
sqlite::query Struct Reference

query should be used to execute SQL queries An object of this class is not copyable More...

#include <query.hpp>

Inheritance diagram for sqlite::query:
Inheritance graph
Collaboration diagram for sqlite::query:
Collaboration graph

Public Member Functions

 query (connection &con, std::string const &sql)
 constructor
 
virtual ~query ()
 destructor
 
result_type emit_result ()
 executes the sql command
 
result_type get_result ()
 returns the results (needs a previous emit() call)
 
- Public Member Functions inherited from sqlite::command
 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
 
commandoperator% (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
 
commandoperator% (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
 
commandoperator% (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
 
commandoperator% (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
 
commandoperator% (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
 
commandoperator% (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
 

Private Member Functions

void access_check ()
 
bool step ()
 

Private Attributes

int last_arg_idx
 

Friends

struct result
 

Additional Inherited Members

- Protected Member Functions inherited from sqlite::command
void access_check ()
 
bool step ()
 
struct sqlite3 * get_handle ()
 
- Protected Attributes inherited from sqlite::command
sqlite3_stmt * stmt
 

Detailed Description

query should be used to execute SQL queries An object of this class is not copyable

Definition at line 44 of file query.hpp.

Constructor & Destructor Documentation

sqlite::query::query ( connection con,
std::string const &  sql 
)

constructor

Parameters
conreference to the connection which should be used
sqlis the SQL query statement
virtual sqlite::query::~query ( )
virtual

destructor

Member Function Documentation

void sqlite::query::access_check ( )
private
result_type sqlite::query::emit_result ( )

executes the sql command

Returns
result_type which is boost::shared_ptr<result>
result_type sqlite::query::get_result ( )

returns the results (needs a previous emit() call)

Returns
result_type which is boost::shared_ptr<result>
bool sqlite::query::step ( )
private

Friends And Related Function Documentation

friend struct result
friend

Definition at line 67 of file query.hpp.

Member Data Documentation

int sqlite::query::last_arg_idx
private

Definition at line 66 of file query.hpp.


The documentation for this struct was generated from the following file: