An abstract base class for interfacing with relational databases.
More...
#include <backend.hpp>
|
| class | Cursor |
| | An abstract base class for cursors that iterate result sets returned by relational database. More...
|
| class | Result |
|
|
virtual | ~Backend () |
| | empty
|
|
virtual bool | supportsSequences () const |
| | return true if backend supports CREATE SEQUENCE - SQL-statements
|
| virtual string | getRowIDType () const |
| | backend may want to set an AUTO_INCREMENT-attribute for table's primary key field.
|
|
virtual string | getInsertID () const |
| | if backend supports this, new primary key of the last insert is returned
|
|
virtual void | begin () const |
| | begin SQL transaction, may or may not have an effect
|
|
virtual void | commit () const |
| | commit SQL transaction
|
|
virtual void | rollback () const |
| | rollback SQL transaction
|
| virtual Result * | execute (const string &query) const =0 |
| | executes SQL-query
|
| virtual Cursor * | cursor (const string &query) const =0 |
| | executes SQL-query
|
| virtual string | groupInsert (Record tables, Records fields, Records values, const string &sequence) const |
| | executes multiple INSERT-statements and assigns same 'row id' for first field of every record
|
|
| static Backend * | getBackend (const string &type, const string &connInfo) |
| | returns a backend according to Backendtype in type, parameters are specific to backend and are separated by semicolon.
|
An abstract base class for interfacing with relational databases.
◆ cursor()
| virtual Cursor * litesql::Backend::cursor |
( |
const string & | query | ) |
const |
|
pure virtual |
executes SQL-query
- Parameters
-
| query | SQL-query to execute |
- Returns
- Cursor-object which can be used to iterate result set row by row without loading everything to memory
◆ execute()
| virtual Result * litesql::Backend::execute |
( |
const string & | query | ) |
const |
|
pure virtual |
executes SQL-query
- Parameters
-
| query | SQL-query to execute |
- Returns
- Result-object which holds result set of query
Referenced by groupInsert().
◆ getBackend()
| Backend * Backend::getBackend |
( |
const string & | type, |
|
|
const string & | connInfo ) |
|
static |
returns a backend according to Backendtype in type, parameters are specific to backend and are separated by semicolon.
- Parameters
-
| type | type of the database backend (supported are : "mysql","postgresql","sqlite3","odbc" |
| connInfo | database connection specific parameters (parameters are separated by semicolon) |
- Exceptions
-
◆ getRowIDType()
| virtual string litesql::Backend::getRowIDType |
( |
| ) |
const |
|
inlinevirtual |
backend may want to set an AUTO_INCREMENT-attribute for table's primary key field.
this method is to deliver the details to database schema
◆ groupInsert()
| string Backend::groupInsert |
( |
Record | tables, |
|
|
Records | fields, |
|
|
Records | values, |
|
|
const string & | sequence ) const |
|
virtual |
The documentation for this class was generated from the following files: