#include <sqlquery.hpp>
Public Member Functions | |
| SqlQuery (const SqlDatabase &db) | |
| Constructor. | |
| SqlResult | operator() (const string &sql) |
| Send a query. | |
| SqlResult | operator() (ostringstream &sql) |
| Send a query. | |
SqlDatabase *db = new Sqlite3Context( "test.db" ); // open connection SqlQuery query( *db ); query( "INSERT INTO my_table VALUES( 1, 2, 'three' );" ); // used as a function delete db; // closed and cleaned up
Definition at line 48 of file sqlquery.hpp.
| SqlQuery::SqlQuery | ( | const SqlDatabase & | db | ) |
Constructor.
Create a new object used for querying databases.
| db | A reference to an open database connection. |
Definition at line 31 of file sqlquery.cpp.
| SqlResult SqlQuery::operator() | ( | const string & | sql | ) |
Send a query.
Send a string containing one or more SQL statements to the database connection you specified in the constructor.
| sql | The statement(s) you want to send. |
| SqlResult SqlQuery::operator() | ( | ostringstream & | sql | ) |
Send a query.
1.5.0