|
LiteSQL
0.3.10
|
An abstract base class for interfacing with relational databases. More...
#include <backend.hpp>
Classes | |
| class | Cursor |
| An abstract base class for cursors that iterate result sets returned by relational database. More... | |
| class | Result |
Public Member Functions | |
| 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. More... | |
| 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 More... | |
| virtual Cursor * | cursor (const string &query) const =0 |
| executes SQL-query More... | |
| 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 More... | |
Static Public Member Functions | |
| 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. More... | |
An abstract base class for interfacing with relational databases.
|
pure virtual |
executes SQL-query
| query | SQL-query to execute |
|
pure virtual |
executes SQL-query
| query | SQL-query to execute |
Referenced by litesql::Database::query().
|
static |
returns a backend according to Backendtype in type, parameters are specific to backend and are separated by semicolon.
| type | type of the database backend (supported are : "mysql","postgresql","sqlite3","odbc" |
| connInfo | database connection specific parameters (parameters are separated by semicolon) |
| DatabaseError | if no backend is found |
|
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
|
virtual |
executes multiple INSERT-statements and assigns same 'row id' for first field of every record
| tables | destination tables for insert operation |
| fields | record of field names per table |
| values | record of values per table |
| sequence | sequence where row id-numbers are pulled |
References litesql::escapeSQL(), litesql::Split::join(), and litesql::Backend::Result::records().
Referenced by litesql::Database::groupInsert().