digikam
Digikam::DatabaseCoreBackend Class Reference
#include <databasecorebackend.h>

Public Types | |
| enum | Status { Unavailable, Open, OpenSchemaChecked } |
Public Member Functions | |
| DatabaseCoreBackend (const QString &backendName, DatabaseCoreBackendPrivate &dd) | |
| DatabaseCoreBackend (const QString &backendName) | |
| ~DatabaseCoreBackend () | |
| bool | beginTransaction () |
| void | close () |
| bool | commitTransaction () |
| bool | exec (QSqlQuery &query) |
| bool | execBatch (QSqlQuery &query) |
| QSqlQuery | execQuery (const QString &sql, const QList< QVariant > &boundValues) |
| QSqlQuery | execQuery (const QString &sql, const QVariant &boundValue1, const QVariant &boundValue2, const QVariant &boundValue3, const QVariant &boundValue4) |
| QSqlQuery | execQuery (const QString &sql, const QVariant &boundValue1, const QVariant &boundValue2, const QVariant &boundValue3) |
| QSqlQuery | execQuery (const QString &sql, const QVariant &boundValue1, const QVariant &boundValue2) |
| QSqlQuery | execQuery (const QString &sql, const QVariant &boundValue1) |
| QSqlQuery | execQuery (const QString &sql) |
| bool | execSql (const QString &sql, const QList< QVariant > &boundValues, QList< QVariant > *values=0, QVariant *lastInsertId=0) |
| bool | execSql (const QString &sql, const QVariant &boundValue1, const QVariant &boundValue2, const QVariant &boundValue3, const QVariant &boundValue4, QList< QVariant > *values=0, QVariant *lastInsertId=0) |
| bool | execSql (const QString &sql, const QVariant &boundValue1, const QVariant &boundValue2, const QVariant &boundValue3, QList< QVariant > *values=0, QVariant *lastInsertId=0) |
| bool | execSql (const QString &sql, const QVariant &boundValue1, const QVariant &boundValue2, QList< QVariant > *values=0, QVariant *lastInsertId=0) |
| bool | execSql (const QString &sql, const QVariant &boundValue1, QList< QVariant > *values=0, QVariant *lastInsertId=0) |
| bool | execSql (const QString &sql, QList< QVariant > *values=0, QVariant *lastInsertId=0) |
| bool | initSchema (ThumbnailSchemaUpdater *updater) |
| bool | isCompatible (const DatabaseParameters ¶meters) |
| bool | isInTransaction () const |
| bool | isOpen () const |
| bool | isReady () const |
| QString | lastError () |
| bool | open (const DatabaseParameters ¶meters) |
| QSqlQuery | prepareQuery (const QString &sql) |
| QList< QVariant > | readToList (QSqlQuery &query) |
| void | rollbackTransaction () |
| Status | status () const |
| QStringList | tables () |
Protected Attributes | |
| DatabaseCoreBackendPrivate *const | d_ptr |
Detailed Description
Definition at line 45 of file databasecorebackend.h.
Member Enumeration Documentation
- Enumerator:
Definition at line 84 of file databasecorebackend.h.
Constructor & Destructor Documentation
| Digikam::DatabaseCoreBackend::DatabaseCoreBackend | ( | const QString & | backendName | ) |
Creates a database backend.
The backend name is an arbitrary string that shall be unique for this backend object. It will be used to create unique connection names per backend and thread.
Definition at line 160 of file databasecorebackend.cpp.
| Digikam::DatabaseCoreBackend::DatabaseCoreBackend | ( | const QString & | backendName, | |
| DatabaseCoreBackendPrivate & | dd | |||
| ) |
Definition at line 166 of file databasecorebackend.cpp.
| Digikam::DatabaseCoreBackend::~DatabaseCoreBackend | ( | ) |
Definition at line 172 of file databasecorebackend.cpp.
Member Function Documentation
| bool Digikam::DatabaseCoreBackend::beginTransaction | ( | ) |
Begin a database transaction.
Definition at line 490 of file databasecorebackend.cpp.
| void Digikam::DatabaseCoreBackend::close | ( | ) |
Close the database connection.
Shall only be called from the thread that called open().
Definition at line 226 of file databasecorebackend.cpp.
| bool Digikam::DatabaseCoreBackend::commitTransaction | ( | ) |
Commit the current database transaction.
Definition at line 507 of file databasecorebackend.cpp.
| bool Digikam::DatabaseCoreBackend::exec | ( | QSqlQuery & | query | ) |
Calls exec/execBatch on the query, and handles debug output if something went wrong.
Definition at line 431 of file databasecorebackend.cpp.
| bool Digikam::DatabaseCoreBackend::execBatch | ( | QSqlQuery & | query | ) |
Definition at line 465 of file databasecorebackend.cpp.
| QSqlQuery Digikam::DatabaseCoreBackend::execQuery | ( | const QString & | sql, | |
| const QList< QVariant > & | boundValues | |||
| ) |
Definition at line 396 of file databasecorebackend.cpp.
| QSqlQuery Digikam::DatabaseCoreBackend::execQuery | ( | const QString & | sql, | |
| const QVariant & | boundValue1, | |||
| const QVariant & | boundValue2, | |||
| const QVariant & | boundValue3, | |||
| const QVariant & | boundValue4 | |||
| ) |
Definition at line 383 of file databasecorebackend.cpp.
| QSqlQuery Digikam::DatabaseCoreBackend::execQuery | ( | const QString & | sql, | |
| const QVariant & | boundValue1, | |||
| const QVariant & | boundValue2, | |||
| const QVariant & | boundValue3 | |||
| ) |
Definition at line 372 of file databasecorebackend.cpp.
| QSqlQuery Digikam::DatabaseCoreBackend::execQuery | ( | const QString & | sql, | |
| const QVariant & | boundValue1, | |||
| const QVariant & | boundValue2 | |||
| ) |
Definition at line 362 of file databasecorebackend.cpp.
| QSqlQuery Digikam::DatabaseCoreBackend::execQuery | ( | const QString & | sql, | |
| const QVariant & | boundValue1 | |||
| ) |
Definition at line 354 of file databasecorebackend.cpp.
Executes the statement and returns the query object.
Methods are provided for up to four bound values (positional binding), or for a list of bound values.
Definition at line 405 of file databasecorebackend.cpp.
| bool Digikam::DatabaseCoreBackend::execSql | ( | const QString & | sql, | |
| const QList< QVariant > & | boundValues, | |||
| QList< QVariant > * | values = 0, |
|||
| QVariant * | lastInsertId = 0 | |||
| ) |
Definition at line 341 of file databasecorebackend.cpp.
| bool Digikam::DatabaseCoreBackend::execSql | ( | const QString & | sql, | |
| const QVariant & | boundValue1, | |||
| const QVariant & | boundValue2, | |||
| const QVariant & | boundValue3, | |||
| const QVariant & | boundValue4, | |||
| QList< QVariant > * | values = 0, |
|||
| QVariant * | lastInsertId = 0 | |||
| ) |
Definition at line 326 of file databasecorebackend.cpp.
| bool Digikam::DatabaseCoreBackend::execSql | ( | const QString & | sql, | |
| const QVariant & | boundValue1, | |||
| const QVariant & | boundValue2, | |||
| const QVariant & | boundValue3, | |||
| QList< QVariant > * | values = 0, |
|||
| QVariant * | lastInsertId = 0 | |||
| ) |
Definition at line 311 of file databasecorebackend.cpp.
| bool Digikam::DatabaseCoreBackend::execSql | ( | const QString & | sql, | |
| const QVariant & | boundValue1, | |||
| const QVariant & | boundValue2, | |||
| QList< QVariant > * | values = 0, |
|||
| QVariant * | lastInsertId = 0 | |||
| ) |
Definition at line 297 of file databasecorebackend.cpp.
| bool Digikam::DatabaseCoreBackend::execSql | ( | const QString & | sql, | |
| const QVariant & | boundValue1, | |||
| QList< QVariant > * | values = 0, |
|||
| QVariant * | lastInsertId = 0 | |||
| ) |
Definition at line 284 of file databasecorebackend.cpp.
| bool Digikam::DatabaseCoreBackend::execSql | ( | const QString & | sql, | |
| QList< QVariant > * | values = 0, |
|||
| QVariant * | lastInsertId = 0 | |||
| ) |
Executes the SQL statement, and write the returned data into the values list.
If you are not interested in the returned data, set values to 0. Methods are provided for up to four bound values (positional binding), or for a list of bound values. If you want the last inserted id (and your query is suitable), sett lastInsertId to the address of a QVariant.
Definition at line 272 of file databasecorebackend.cpp.
| bool Digikam::DatabaseCoreBackend::initSchema | ( | ThumbnailSchemaUpdater * | updater | ) |
Initialize the database schema to the current version, carry out upgrades if necessary.
Shall only be called from the thread that called open().
Definition at line 211 of file databasecorebackend.cpp.
| bool Digikam::DatabaseCoreBackend::isCompatible | ( | const DatabaseParameters & | parameters | ) |
Checks if the parameters can be used for this database backend.
Definition at line 190 of file databasecorebackend.cpp.
| bool Digikam::DatabaseCoreBackend::isInTransaction | ( | ) | const |
Returns if the database is in a different thread in a transaction.
Note that a transaction does not require holding DatabaseAccess. Note that this does not give information about other processes locking the database.
Definition at line 523 of file databasecorebackend.cpp.
| bool Digikam::DatabaseCoreBackend::isOpen | ( | ) | const [inline] |
Definition at line 111 of file databasecorebackend.h.
| bool Digikam::DatabaseCoreBackend::isReady | ( | ) | const [inline] |
Definition at line 112 of file databasecorebackend.h.
| QString Digikam::DatabaseCoreBackend::lastError | ( | ) |
Returns a description of the last error that occurred on this database.
Use DatabaseAccess::lastError for errors presented to the user. This error will be included in that message. It may be empty.
Definition at line 542 of file databasecorebackend.cpp.
| bool Digikam::DatabaseCoreBackend::open | ( | const DatabaseParameters & | parameters | ) |
Open the database connection.
- Returns:
- true on success
Definition at line 195 of file databasecorebackend.cpp.
Creates a query object prepared with the statement, waiting for bound values.
Definition at line 480 of file databasecorebackend.cpp.
Definition at line 257 of file databasecorebackend.cpp.
| void Digikam::DatabaseCoreBackend::rollbackTransaction | ( | ) |
Rollback the current database transaction.
Definition at line 529 of file databasecorebackend.cpp.
| DatabaseCoreBackend::Status Digikam::DatabaseCoreBackend::status | ( | ) | const |
Returns the current status of the database backend.
Definition at line 233 of file databasecorebackend.cpp.
| QStringList Digikam::DatabaseCoreBackend::tables | ( | ) |
Return a list with the names of the tables in the database.
Definition at line 536 of file databasecorebackend.cpp.
Member Data Documentation
DatabaseCoreBackendPrivate* const Digikam::DatabaseCoreBackend::d_ptr [protected] |
Definition at line 227 of file databasecorebackend.h.
The documentation for this class was generated from the following files:
KDE 4.5 API Reference