25 #ifndef DIGIKAM_DB_ENGINE_BACKEND_H
26 #define DIGIKAM_DB_ENGINE_BACKEND_H
33 #include <QStringList>
36 #include <QRecursiveMutex>
47 class DbEngineConfigSettings;
48 class BdEngineBackendPrivate;
49 class DbEngineErrorHandler;
175 operator bool()
const
194 return (status() > Unavailable);
199 return (status() == OpenSchemaChecked);
217 DbType databaseType()
const;
232 QueryState execDBAction(
const QString& action,
QList<QVariant>*
const values =
nullptr, QVariant*
const lastInsertId =
nullptr);
240 QueryState execDBAction(
const DbEngineAction& action,
const QMap<QString, QVariant>& bindingMap,
241 QList<QVariant>*
const values =
nullptr, QVariant*
const lastInsertId =
nullptr);
243 QueryState execDBAction(
const QString& action,
const QMap<QString, QVariant>& bindingMap,
244 QList<QVariant>*
const values =
nullptr, QVariant*
const lastInsertId =
nullptr);
254 QueryState execUpsertDBAction(
const DbEngineAction& action,
const QVariant&
id,
256 QueryState execUpsertDBAction(
const QString& action,
const QVariant&
id,
266 QSqlQuery execDBActionQuery(
const DbEngineAction& action,
const QMap<QString, QVariant>& bindingMap);
268 QSqlQuery execDBActionQuery(
const QString& action,
const QMap<QString, QVariant>& bindingMap);
277 QueryState execSql(
const QString& sql,
279 QVariant*
const lastInsertId =
nullptr);
280 QueryState execSql(
const QString& sql,
281 const QVariant& boundValue1,
283 QVariant*
const lastInsertId =
nullptr);
284 QueryState execSql(
const QString& sql,
285 const QVariant& boundValue1,
286 const QVariant& boundValue2,
288 QVariant*
const lastInsertId =
nullptr);
289 QueryState execSql(
const QString& sql,
290 const QVariant& boundValue1,
291 const QVariant& boundValue2,
292 const QVariant& boundValue3,
294 QVariant*
const lastInsertId =
nullptr);
295 QueryState execSql(
const QString& sql,
296 const QVariant& boundValue1,
297 const QVariant& boundValue2,
298 const QVariant& boundValue3,
299 const QVariant& boundValue4,
301 QVariant*
const lastInsertId =
nullptr);
302 QueryState execSql(
const QString& sql,
305 QVariant*
const lastInsertId =
nullptr);
309 QVariant*
const lastInsertId =
nullptr);
311 const QVariant& boundValue1,
313 QVariant*
const lastInsertId =
nullptr);
315 const QVariant& boundValue1,
316 const QVariant& boundValue2,
318 QVariant*
const lastInsertId =
nullptr);
320 const QVariant& boundValue1,
321 const QVariant& boundValue2,
322 const QVariant& boundValue3,
324 QVariant*
const lastInsertId =
nullptr);
326 const QVariant& boundValue1,
327 const QVariant& boundValue2,
328 const QVariant& boundValue3,
329 const QVariant& boundValue4,
331 QVariant*
const lastInsertId =
nullptr);
335 QVariant*
const lastInsertId =
nullptr);
345 QVariant*
const lastInsertId);
357 QueryState execSql(
const QString& sql,
358 const QMap<QString, QVariant>& bindingMap,
360 QVariant*
const lastInsertId =
nullptr);
366 QueryState execDirectSql(
const QString& query);
373 QueryState execDirectSqlWithResult(
const QString& query,
375 QVariant*
const lastInsertId =
nullptr);
383 const QVariant& boundValue1);
385 const QVariant& boundValue1,
386 const QVariant& boundValue2);
388 const QVariant& boundValue1,
389 const QVariant& boundValue2,
390 const QVariant& boundValue3);
392 const QVariant& boundValue1,
393 const QVariant& boundValue2,
394 const QVariant& boundValue3,
395 const QVariant& boundValue4);
403 const QVariant& boundValue1);
405 const QVariant& boundValue1,
406 const QVariant& boundValue2);
408 const QVariant& boundValue1,
409 const QVariant& boundValue2,
410 const QVariant& boundValue3);
412 const QVariant& boundValue1,
413 const QVariant& boundValue2,
414 const QVariant& boundValue3,
415 const QVariant& boundValue4);
423 const QMap<QString, QVariant>& bindingMap);
450 bool transactionErrorHandling(
const QSqlError& lastError,
int retries);
457 bool connectionErrorHandling(
int retries);
478 void rollbackTransaction();
486 bool isInTransaction()
const;
491 QStringList tables();
506 QSqlError lastSQLError();
512 int maximumBoundValues()
const;
518 void setForeignKeyChecks(
bool check);
558 Q_DECLARE_METATYPE(QSqlError)
Definition: dbenginebackend_p.h:67
Definition: dbenginebackend.h:157
QueryState()
Definition: dbenginebackend.h:160
QueryState(const QueryStateEnum value)
Definition: dbenginebackend.h:165
Definition: dbenginebackend.h:66
BdEngineBackendPrivate *const d_ptr
Definition: dbenginebackend.h:546
Status
Definition: dbenginebackend.h:90
@ Unavailable
Definition: dbenginebackend.h:95
@ Open
Definition: dbenginebackend.h:104
QueryStateEnum
Definition: dbenginebackend.h:72
@ SQLError
Definition: dbenginebackend.h:81
@ NoErrors
Definition: dbenginebackend.h:76
QueryOperationStatus
Definition: dbenginebackend.h:114
@ Wait
Definition: dbenginebackend.h:116
@ ExecuteNormal
Definition: dbenginebackend.h:115
DbType
Definition: dbenginebackend.h:121
@ SQLite
Definition: dbenginebackend.h:122
bool isReady() const
Definition: dbenginebackend.h:197
bool isOpen() const
Definition: dbenginebackend.h:192
Definition: dbengineaction.h:57
Definition: dbengineconfigsettings.h:40
Definition: dbengineerrorhandler.h:60
Definition: dbenginebackend.h:52
QRecursiveMutex mutex
Definition: dbenginebackend.h:59
int lockCount
Definition: dbenginebackend.h:60
Definition: dbengineparameters.h:49
Definition: dbenginesqlquery.h:41
qulonglong value
Definition: itemviewutilities.cpp:592
Status
Definition: coredbconstants.h:85
Definition: datefolderview.cpp:43