digiKam
Digikam::SimilarityDbBackend Class Reference
+ Inheritance diagram for Digikam::SimilarityDbBackend:

Public Types

enum  DbType { SQLite , MySQL }
 
enum  QueryOperationStatus { ExecuteNormal , Wait , AbortQueries }
 
enum  QueryStateEnum { NoErrors , SQLError , ConnectionError }
 
enum  Status { Unavailable , Open , OpenSchemaChecked }
 

Public Member Functions

BdEngineBackend::QueryState beginTransaction ()
 
void close ()
 
BdEngineBackend::QueryState commitTransaction ()
 
DbEngineConfigSettings configElement () const
 
bool connectionErrorHandling (int retries)
 
DbEngineSqlQuery copyQuery (const DbEngineSqlQuery &old)
 
DbType databaseType () const
 
bool exec (DbEngineSqlQuery &query)
 
bool execBatch (DbEngineSqlQuery &query)
 
QueryState execDBAction (const DbEngineAction &action, const QMap< QString, QVariant > &bindingMap, QList< QVariant > *const values=nullptr, QVariant *const lastInsertId=nullptr)
 
QueryState execDBAction (const DbEngineAction &action, QList< QVariant > *const values=nullptr, QVariant *const lastInsertId=nullptr)
 
QueryState execDBAction (const QString &action, const QMap< QString, QVariant > &bindingMap, QList< QVariant > *const values=nullptr, QVariant *const lastInsertId=nullptr)
 
QueryState execDBAction (const QString &action, QList< QVariant > *const values=nullptr, QVariant *const lastInsertId=nullptr)
 
QSqlQuery execDBActionQuery (const DbEngineAction &action, const QMap< QString, QVariant > &bindingMap)
 
QSqlQuery execDBActionQuery (const QString &action, const QMap< QString, QVariant > &bindingMap)
 
QueryState execDirectSql (const QString &query)
 
QueryState execDirectSqlWithResult (const QString &query, QList< QVariant > *const values=nullptr, QVariant *const lastInsertId=nullptr)
 
DbEngineSqlQuery execQuery (const QString &sql)
 
DbEngineSqlQuery execQuery (const QString &sql, const QList< QVariant > &boundValues)
 
DbEngineSqlQuery execQuery (const QString &sql, const QMap< QString, QVariant > &bindingMap)
 
DbEngineSqlQuery execQuery (const QString &sql, const QVariant &boundValue1)
 
DbEngineSqlQuery execQuery (const QString &sql, const QVariant &boundValue1, const QVariant &boundValue2)
 
DbEngineSqlQuery execQuery (const QString &sql, const QVariant &boundValue1, const QVariant &boundValue2, const QVariant &boundValue3)
 
DbEngineSqlQuery execQuery (const QString &sql, const QVariant &boundValue1, const QVariant &boundValue2, const QVariant &boundValue3, const QVariant &boundValue4)
 
void execQuery (DbEngineSqlQuery &preparedQuery, const QList< QVariant > &boundValues)
 
void execQuery (DbEngineSqlQuery &preparedQuery, const QVariant &boundValue1)
 
void execQuery (DbEngineSqlQuery &preparedQuery, const QVariant &boundValue1, const QVariant &boundValue2)
 
void execQuery (DbEngineSqlQuery &preparedQuery, const QVariant &boundValue1, const QVariant &boundValue2, const QVariant &boundValue3)
 
void execQuery (DbEngineSqlQuery &preparedQuery, const QVariant &boundValue1, const QVariant &boundValue2, const QVariant &boundValue3, const QVariant &boundValue4)
 
QueryState execSql (const QString &sql, const QList< QVariant > &boundValues, QList< QVariant > *const values=nullptr, QVariant *const lastInsertId=nullptr)
 
QueryState execSql (const QString &sql, const QMap< QString, QVariant > &bindingMap, QList< QVariant > *const values=nullptr, QVariant *const lastInsertId=nullptr)
 
QueryState execSql (const QString &sql, const QVariant &boundValue1, const QVariant &boundValue2, const QVariant &boundValue3, const QVariant &boundValue4, QList< QVariant > *const values=nullptr, QVariant *const lastInsertId=nullptr)
 
QueryState execSql (const QString &sql, const QVariant &boundValue1, const QVariant &boundValue2, const QVariant &boundValue3, QList< QVariant > *const values=nullptr, QVariant *const lastInsertId=nullptr)
 
QueryState execSql (const QString &sql, const QVariant &boundValue1, const QVariant &boundValue2, QList< QVariant > *const values=nullptr, QVariant *const lastInsertId=nullptr)
 
QueryState execSql (const QString &sql, const QVariant &boundValue1, QList< QVariant > *const values=nullptr, QVariant *const lastInsertId=nullptr)
 
QueryState execSql (const QString &sql, QList< QVariant > *const values=nullptr, QVariant *const lastInsertId=nullptr)
 
QueryState execSql (DbEngineSqlQuery &preparedQuery, const QList< QVariant > &boundValues, QList< QVariant > *const values=nullptr, QVariant *const lastInsertId=nullptr)
 
QueryState execSql (DbEngineSqlQuery &preparedQuery, const QVariant &boundValue1, const QVariant &boundValue2, const QVariant &boundValue3, const QVariant &boundValue4, QList< QVariant > *const values=nullptr, QVariant *const lastInsertId=nullptr)
 
QueryState execSql (DbEngineSqlQuery &preparedQuery, const QVariant &boundValue1, const QVariant &boundValue2, const QVariant &boundValue3, QList< QVariant > *const values=nullptr, QVariant *const lastInsertId=nullptr)
 
QueryState execSql (DbEngineSqlQuery &preparedQuery, const QVariant &boundValue1, const QVariant &boundValue2, QList< QVariant > *const values=nullptr, QVariant *const lastInsertId=nullptr)
 
QueryState execSql (DbEngineSqlQuery &preparedQuery, const QVariant &boundValue1, QList< QVariant > *const values=nullptr, QVariant *const lastInsertId=nullptr)
 
QueryState execSql (DbEngineSqlQuery &preparedQuery, QList< QVariant > *const values=nullptr, QVariant *const lastInsertId=nullptr)
 
QueryState execUpsertDBAction (const DbEngineAction &action, const QVariant &id, const QStringList &fieldNames, const QList< QVariant > &values)
 
QueryState execUpsertDBAction (const QString &action, const QVariant &id, const QStringList &fieldNames, const QList< QVariant > &values)
 
DbEngineAction getDBAction (const QString &actionName) const
 
DbEngineSqlQuery getQuery ()
 
QueryState handleQueryResult (DbEngineSqlQuery &query, QList< QVariant > *const values, QVariant *const lastInsertId)
 
bool initSchema (SimilarityDbSchemaUpdater *const updater)
 
bool isCompatible (const DbEngineParameters &parameters)
 
bool isInTransaction () const
 
bool isOpen () const
 
bool isReady () const
 
QString lastError ()
 
QSqlError lastSQLError ()
 
int maximumBoundValues () const
 
bool open (const DbEngineParameters &parameters)
 
DbEngineSqlQuery prepareQuery (const QString &sql)
 
bool queryErrorHandling (DbEngineSqlQuery &query, int retries)
 
QList< QVariant > readToList (DbEngineSqlQuery &query)
 
void rollbackTransaction ()
 
void setDbEngineErrorHandler (DbEngineErrorHandler *const handler)
 
void setForeignKeyChecks (bool check)
 
 SimilarityDbBackend (DbEngineLocking *const locking, const QString &backendName=QLatin1String("similarityDatabase-"))
 
Status status () const
 
QStringList tables ()
 
bool transactionErrorHandling (const QSqlError &lastError, int retries)
 
 ~SimilarityDbBackend () override
 

Protected Attributes

BdEngineBackendPrivate *const d_ptr
 

Member Enumeration Documentation

◆ DbType

Enumerator
SQLite 
MySQL 

◆ QueryOperationStatus

Enumerator
ExecuteNormal 
Wait 
AbortQueries 

◆ QueryStateEnum

Enumerator
NoErrors 

No errors occurred while executing the query.

SQLError 

An SQLError has occurred while executing the query.

ConnectionError 

An connection error has occurred while executing the query.

◆ Status

Enumerator
Unavailable 

The database is not available, because it has not been opened yet or because of an error condition.

Open 

The database is open. It has not been verified that the schema is up to date. This status is sufficient for use in a context where it can be assumed that the necessary schema check has been carried out by a master process.

OpenSchemaChecked 

The database is open, and it has been verified that the schema is up to date, or the schema has been updated.

Constructor & Destructor Documentation

◆ SimilarityDbBackend()

Digikam::SimilarityDbBackend::SimilarityDbBackend ( DbEngineLocking *const  locking,
const QString &  backendName = QLatin1String("similarityDatabase-") 
)
explicit

◆ ~SimilarityDbBackend()

Digikam::SimilarityDbBackend::~SimilarityDbBackend ( )
override

Member Function Documentation

◆ beginTransaction()

◆ close()

void Digikam::BdEngineBackend::close ( )
inherited

Close the database connection. Shall only be called from the thread that called open().

References Digikam::BdEngineBackend::Unavailable.

Referenced by Digikam::CoreDbCopyManager::copyDatabases(), and Digikam::BdEngineBackend::~BdEngineBackend().

◆ commitTransaction()

◆ configElement()

DbEngineConfigSettings Digikam::BdEngineBackend::configElement ( ) const
inherited

Return config read from XML, corresponding to this backend's database type.

References Digikam::DbEngineConfig::element().

Referenced by Digikam::BdEngineBackend::getDBAction().

◆ connectionErrorHandling()

bool Digikam::BdEngineBackend::connectionErrorHandling ( int  retries)
inherited

Called when an attempted connection to the database failed. If it returns true, retry; if it returns false, bail out. Pass the number of connection retries to help with some decisions.

Referenced by Digikam::BdEngineBackend::open().

◆ copyQuery()

DbEngineSqlQuery Digikam::BdEngineBackend::copyQuery ( const DbEngineSqlQuery old)
inherited

Creates a faithful copy of the passed query, with the current db connection.

References Digikam::BdEngineBackend::getQuery(), Digikam::DbEngineSqlQuery::lastQuery(), Digikam::DbEngineSqlQuery::prepare(), and value.

Referenced by Digikam::BdEngineBackend::queryErrorHandling().

◆ databaseType()

BdEngineBackend::DbType Digikam::BdEngineBackend::databaseType ( ) const
inherited

Return the database type.

Referenced by Digikam::FaceDb::integrityCheck().

◆ exec()

bool Digikam::BdEngineBackend::exec ( DbEngineSqlQuery query)
inherited

Calls exec/execBatch on the query, and handles debug output if something went wrong

References Digikam::BdEngineBackend::queryErrorHandling().

Referenced by Digikam::BdEngineBackend::execQuery(), and Digikam::BdEngineBackend::execSql().

◆ execBatch()

bool Digikam::BdEngineBackend::execBatch ( DbEngineSqlQuery query)
inherited

◆ execDBAction() [1/4]

BdEngineBackend::QueryState Digikam::BdEngineBackend::execDBAction ( const DbEngineAction action,
const QMap< QString, QVariant > &  bindingMap,
QList< QVariant > *const  values = nullptr,
QVariant *const  lastInsertId = nullptr 
)
inherited

◆ execDBAction() [2/4]

BdEngineBackend::QueryState Digikam::BdEngineBackend::execDBAction ( const DbEngineAction action,
QList< QVariant > *const  values = nullptr,
QVariant *const  lastInsertId = nullptr 
)
inherited

Performs the database action on the current database. Queries by the specified parameters mustn't have named parameters. The result values (if any) are stored within the values list.

Referenced by Digikam::CoreDbPrivilegesChecker::checkPriv(), Digikam::CoreDbCopyManager::copyDatabases(), Digikam::BdEngineBackend::execDBAction(), Digikam::BdEngineBackend::execUpsertDBAction(), Digikam::FaceDb::integrityCheck(), Digikam::ItemLister::listTag(), Digikam::FaceDb::setSetting(), Digikam::FaceDb::setting(), and Digikam::FaceDb::vacuum().

◆ execDBAction() [3/4]

BdEngineBackend::QueryState Digikam::BdEngineBackend::execDBAction ( const QString &  action,
const QMap< QString, QVariant > &  bindingMap,
QList< QVariant > *const  values = nullptr,
QVariant *const  lastInsertId = nullptr 
)
inherited

◆ execDBAction() [4/4]

BdEngineBackend::QueryState Digikam::BdEngineBackend::execDBAction ( const QString &  action,
QList< QVariant > *const  values = nullptr,
QVariant *const  lastInsertId = nullptr 
)
inherited

◆ execDBActionQuery() [1/2]

QSqlQuery Digikam::BdEngineBackend::execDBActionQuery ( const DbEngineAction action,
const QMap< QString, QVariant > &  bindingMap 
)
inherited

Performs the database action on the current database. Queries by the specified parameters can have named parameters which are substituted with values from the bindingMap parameter. The result values (if any) are stored within the values list. This method returns the last query, which is used to handle special cases.

References Digikam::DbEngineAction::dbActionElements, Digikam::BdEngineBackend::execQuery(), Digikam::DbEngineActionElement::mode, Digikam::DbEngineAction::name, and Digikam::DbEngineActionElement::statement.

Referenced by Digikam::BdEngineBackend::execDBActionQuery().

◆ execDBActionQuery() [2/2]

QSqlQuery Digikam::BdEngineBackend::execDBActionQuery ( const QString &  action,
const QMap< QString, QVariant > &  bindingMap 
)
inherited

◆ execDirectSql()

BdEngineBackend::QueryState Digikam::BdEngineBackend::execDirectSql ( const QString &  query)
inherited

Calls exec on the query, and handles debug output if something went wrong. The query is not prepared, which can be fail in certain situations (e.g. trigger statements on QMYSQL).

References Digikam::BdEngineBackend::getQuery(), Digikam::BdEngineBackend::NoErrors, Digikam::BdEngineBackend::queryErrorHandling(), and Digikam::BdEngineBackend::SQLError.

Referenced by Digikam::CoreDbCopyManager::copyDatabases(), and Digikam::BdEngineBackend::execDBAction().

◆ execDirectSqlWithResult()

BdEngineBackend::QueryState Digikam::BdEngineBackend::execDirectSqlWithResult ( const QString &  query,
QList< QVariant > *const  values = nullptr,
QVariant *const  lastInsertId = nullptr 
)
inherited

Calls exec on the query, and handles debug output if something went wrong. The query is not prepared, which can be fail in certain situations (e.g. trigger statements on QMYSQL).

References Digikam::BdEngineBackend::getQuery(), Digikam::BdEngineBackend::handleQueryResult(), Digikam::BdEngineBackend::NoErrors, Digikam::BdEngineBackend::queryErrorHandling(), and Digikam::BdEngineBackend::SQLError.

Referenced by Digikam::BdEngineBackend::execDBAction().

◆ execQuery() [1/12]

DbEngineSqlQuery Digikam::BdEngineBackend::execQuery ( const QString &  sql)
inherited

◆ execQuery() [2/12]

DbEngineSqlQuery Digikam::BdEngineBackend::execQuery ( const QString &  sql,
const QList< QVariant > &  boundValues 
)
inherited

◆ execQuery() [3/12]

DbEngineSqlQuery Digikam::BdEngineBackend::execQuery ( const QString &  sql,
const QMap< QString, QVariant > &  bindingMap 
)
inherited

◆ execQuery() [4/12]

DbEngineSqlQuery Digikam::BdEngineBackend::execQuery ( const QString &  sql,
const QVariant &  boundValue1 
)
inherited

◆ execQuery() [5/12]

DbEngineSqlQuery Digikam::BdEngineBackend::execQuery ( const QString &  sql,
const QVariant &  boundValue1,
const QVariant &  boundValue2 
)
inherited

◆ execQuery() [6/12]

DbEngineSqlQuery Digikam::BdEngineBackend::execQuery ( const QString &  sql,
const QVariant &  boundValue1,
const QVariant &  boundValue2,
const QVariant &  boundValue3 
)
inherited

◆ execQuery() [7/12]

DbEngineSqlQuery Digikam::BdEngineBackend::execQuery ( const QString &  sql,
const QVariant &  boundValue1,
const QVariant &  boundValue2,
const QVariant &  boundValue3,
const QVariant &  boundValue4 
)
inherited

◆ execQuery() [8/12]

void Digikam::BdEngineBackend::execQuery ( DbEngineSqlQuery preparedQuery,
const QList< QVariant > &  boundValues 
)
inherited

◆ execQuery() [9/12]

void Digikam::BdEngineBackend::execQuery ( DbEngineSqlQuery preparedQuery,
const QVariant &  boundValue1 
)
inherited

Binds the values and executes the prepared query.

References Digikam::BdEngineBackend::exec().

◆ execQuery() [10/12]

void Digikam::BdEngineBackend::execQuery ( DbEngineSqlQuery preparedQuery,
const QVariant &  boundValue1,
const QVariant &  boundValue2 
)
inherited

◆ execQuery() [11/12]

void Digikam::BdEngineBackend::execQuery ( DbEngineSqlQuery preparedQuery,
const QVariant &  boundValue1,
const QVariant &  boundValue2,
const QVariant &  boundValue3 
)
inherited

◆ execQuery() [12/12]

void Digikam::BdEngineBackend::execQuery ( DbEngineSqlQuery preparedQuery,
const QVariant &  boundValue1,
const QVariant &  boundValue2,
const QVariant &  boundValue3,
const QVariant &  boundValue4 
)
inherited

◆ execSql() [1/13]

BdEngineBackend::QueryState Digikam::BdEngineBackend::execSql ( const QString &  sql,
const QList< QVariant > &  boundValues,
QList< QVariant > *const  values = nullptr,
QVariant *const  lastInsertId = nullptr 
)
inherited

◆ execSql() [2/13]

BdEngineBackend::QueryState Digikam::BdEngineBackend::execSql ( const QString &  sql,
const QMap< QString, QVariant > &  bindingMap,
QList< QVariant > *const  values = nullptr,
QVariant *const  lastInsertId = nullptr 
)
inherited

Method which accepts a map for named binding. For special cases it's also possible to add a DbEngineActionType which wraps another data object (also lists or maps) which can be used as field entry or as value (where it's prepared with positional binding). See more on DbEngineActionType class. If the wrapped data object is an instance of list, then the elements are separated by comma. If the wrapped data object is an instance of map, then the elements are inserted in the following way: key1=value1, key2=value2,...,keyN=valueN.

References Digikam::BdEngineBackend::execQuery(), and Digikam::BdEngineBackend::handleQueryResult().

◆ execSql() [3/13]

BdEngineBackend::QueryState Digikam::BdEngineBackend::execSql ( const QString &  sql,
const QVariant &  boundValue1,
const QVariant &  boundValue2,
const QVariant &  boundValue3,
const QVariant &  boundValue4,
QList< QVariant > *const  values = nullptr,
QVariant *const  lastInsertId = nullptr 
)
inherited

◆ execSql() [4/13]

BdEngineBackend::QueryState Digikam::BdEngineBackend::execSql ( const QString &  sql,
const QVariant &  boundValue1,
const QVariant &  boundValue2,
const QVariant &  boundValue3,
QList< QVariant > *const  values = nullptr,
QVariant *const  lastInsertId = nullptr 
)
inherited

◆ execSql() [5/13]

BdEngineBackend::QueryState Digikam::BdEngineBackend::execSql ( const QString &  sql,
const QVariant &  boundValue1,
const QVariant &  boundValue2,
QList< QVariant > *const  values = nullptr,
QVariant *const  lastInsertId = nullptr 
)
inherited

◆ execSql() [6/13]

BdEngineBackend::QueryState Digikam::BdEngineBackend::execSql ( const QString &  sql,
const QVariant &  boundValue1,
QList< QVariant > *const  values = nullptr,
QVariant *const  lastInsertId = nullptr 
)
inherited

◆ execSql() [7/13]

BdEngineBackend::QueryState Digikam::BdEngineBackend::execSql ( const QString &  sql,
QList< QVariant > *const  values = nullptr,
QVariant *const  lastInsertId = nullptr 
)
inherited

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), set lastInsertId to the address of a QVariant. Additionally, methods are provided for prepared statements.

References Digikam::BdEngineBackend::execQuery(), and Digikam::BdEngineBackend::handleQueryResult().

Referenced by Digikam::FaceDb::addIdentity(), Digikam::FaceDb::clearDNNTraining(), Digikam::FaceDb::clearIdentities(), Digikam::FaceDb::clearTreeDb(), Digikam::FaceDb::deleteIdentity(), Digikam::BdEngineBackend::execDBAction(), Digikam::FaceDb::getNumberOfIdentities(), Digikam::FaceDb::identities(), Digikam::FaceDb::identityIds(), Digikam::ItemLister::listAreaRange(), Digikam::ItemLister::listDateRange(), Digikam::ItemLister::listFaces(), Digikam::ItemLister::listImageTagPropertySearch(), Digikam::ItemLister::listPAlbum(), Digikam::ItemLister::listSearch(), Digikam::HaarIface::retrieveSignatureFromDB(), Digikam::BdEngineBackend::setForeignKeyChecks(), and Digikam::FaceDb::updateIdentity().

◆ execSql() [8/13]

BdEngineBackend::QueryState Digikam::BdEngineBackend::execSql ( DbEngineSqlQuery preparedQuery,
const QList< QVariant > &  boundValues,
QList< QVariant > *const  values = nullptr,
QVariant *const  lastInsertId = nullptr 
)
inherited

◆ execSql() [9/13]

BdEngineBackend::QueryState Digikam::BdEngineBackend::execSql ( DbEngineSqlQuery preparedQuery,
const QVariant &  boundValue1,
const QVariant &  boundValue2,
const QVariant &  boundValue3,
const QVariant &  boundValue4,
QList< QVariant > *const  values = nullptr,
QVariant *const  lastInsertId = nullptr 
)
inherited

◆ execSql() [10/13]

BdEngineBackend::QueryState Digikam::BdEngineBackend::execSql ( DbEngineSqlQuery preparedQuery,
const QVariant &  boundValue1,
const QVariant &  boundValue2,
const QVariant &  boundValue3,
QList< QVariant > *const  values = nullptr,
QVariant *const  lastInsertId = nullptr 
)
inherited

◆ execSql() [11/13]

BdEngineBackend::QueryState Digikam::BdEngineBackend::execSql ( DbEngineSqlQuery preparedQuery,
const QVariant &  boundValue1,
const QVariant &  boundValue2,
QList< QVariant > *const  values = nullptr,
QVariant *const  lastInsertId = nullptr 
)
inherited

◆ execSql() [12/13]

BdEngineBackend::QueryState Digikam::BdEngineBackend::execSql ( DbEngineSqlQuery preparedQuery,
const QVariant &  boundValue1,
QList< QVariant > *const  values = nullptr,
QVariant *const  lastInsertId = nullptr 
)
inherited

◆ execSql() [13/13]

BdEngineBackend::QueryState Digikam::BdEngineBackend::execSql ( DbEngineSqlQuery preparedQuery,
QList< QVariant > *const  values = nullptr,
QVariant *const  lastInsertId = nullptr 
)
inherited

◆ execUpsertDBAction() [1/2]

BdEngineBackend::QueryState Digikam::BdEngineBackend::execUpsertDBAction ( const DbEngineAction action,
const QVariant &  id,
const QStringList &  fieldNames,
const QList< QVariant > &  values 
)
inherited

Performs a special DBAction that is usually needed to "INSERT or UPDATE" entries in a table. The corresponding DBAction must contain exactly the named parameters :id, :fieldValueList, :fieldList and :valueList. You pass the value to be bound to the ":id" field, then two lists of the same size: The first containing the field names, the second one containing the values as QVariants ready for binding.

References Digikam::BdEngineBackend::execDBAction(), Digikam::DbEngineActionType::fieldEntry(), and Digikam::DbEngineActionType::value().

Referenced by Digikam::BdEngineBackend::execUpsertDBAction().

◆ execUpsertDBAction() [2/2]

BdEngineBackend::QueryState Digikam::BdEngineBackend::execUpsertDBAction ( const QString &  action,
const QVariant &  id,
const QStringList &  fieldNames,
const QList< QVariant > &  values 
)
inherited

◆ getDBAction()

◆ getQuery()

DbEngineSqlQuery Digikam::BdEngineBackend::getQuery ( )
inherited

◆ handleQueryResult()

BdEngineBackend::QueryState Digikam::BdEngineBackend::handleQueryResult ( DbEngineSqlQuery query,
QList< QVariant > *const  values,
QVariant *const  lastInsertId 
)
inherited

Checks if there was a connection error. If so BdEngineBackend::ConnectionError is returned. If not, the values are extracted from the query and inserted in the values list, the last insertion id is taken from the query and BdEngineBackend::NoErrors is returned.

References Digikam::BdEngineBackend::ConnectionError, Digikam::BdEngineBackend::NoErrors, Digikam::BdEngineBackend::readToList(), and Digikam::BdEngineBackend::SQLError.

Referenced by Digikam::BdEngineBackend::execDirectSqlWithResult(), and Digikam::BdEngineBackend::execSql().

◆ initSchema()

bool Digikam::SimilarityDbBackend::initSchema ( SimilarityDbSchemaUpdater *const  updater)

Initialize the database schema to the current version, carry out upgrades if necessary. Shall only be called from the thread that called open().

References Digikam::BdEngineBackend::OpenSchemaChecked, Digikam::BdEngineBackend::Unavailable, and Digikam::SimilarityDbSchemaUpdater::update().

◆ isCompatible()

bool Digikam::BdEngineBackend::isCompatible ( const DbEngineParameters parameters)
inherited

Checks if the parameters can be used for this database backend.

References Digikam::DbEngineParameters::databaseType.

◆ isInTransaction()

bool Digikam::BdEngineBackend::isInTransaction ( ) const
inherited

Returns if the database is in a different thread in a transaction. Note that a transaction does not require holding CoreDbAccess. Note that this does not give information about other processes locking the database.

◆ isOpen()

bool Digikam::BdEngineBackend::isOpen ( ) const
inlineinherited

◆ isReady()

bool Digikam::BdEngineBackend::isReady ( ) const
inlineinherited

◆ lastError()

QString Digikam::BdEngineBackend::lastError ( )
inherited

Returns a description of the last error that occurred on this database. Use CoreDbAccess::lastError for errors presented to the user. This error will be included in that message. It may be empty.

Referenced by Digikam::BdEngineBackend::commitTransaction(), Digikam::ItemLister::listImageTagPropertySearch(), Digikam::ItemLister::listSearch(), and Digikam::BdEngineBackend::transactionErrorHandling().

◆ lastSQLError()

QSqlError Digikam::BdEngineBackend::lastSQLError ( )
inherited

Returns the last error that occurred on this database. Use CoreDbAccess::lastError for errors presented to the user. It may be empty.

Referenced by Digikam::CoreDbPrivilegesChecker::checkPriv().

◆ maximumBoundValues()

int Digikam::BdEngineBackend::maximumBoundValues ( ) const
inherited

Returns the maximum number of bound parameters allowed per query. This value depends on the database engine.

Referenced by Digikam::ItemLister::listPAlbum().

◆ open()

bool Digikam::BdEngineBackend::open ( const DbEngineParameters parameters)
inherited

◆ prepareQuery()

DbEngineSqlQuery Digikam::BdEngineBackend::prepareQuery ( const QString &  sql)
inherited

◆ queryErrorHandling()

bool Digikam::BdEngineBackend::queryErrorHandling ( DbEngineSqlQuery query,
int  retries 
)
inherited

Called with a failed query. Handles certain known errors and debug output. If it returns true, reexecute the query; if it returns false, return it as failed. Pass the number of retries already done for this query to help with some decisions.

References Digikam::BdEngineBackend::copyQuery().

Referenced by Digikam::BdEngineBackend::exec(), Digikam::BdEngineBackend::execBatch(), Digikam::BdEngineBackend::execDirectSql(), Digikam::BdEngineBackend::execDirectSqlWithResult(), and Digikam::BdEngineBackend::prepareQuery().

◆ readToList()

QList< QVariant > Digikam::BdEngineBackend::readToList ( DbEngineSqlQuery query)
inherited

Reads data of returned result set into a list which is returned. The read process is column wise, which means all data elements of a row is read, then the resultset is switched to the next row.

Referenced by Digikam::BdEngineBackend::handleQueryResult().

◆ rollbackTransaction()

void Digikam::BdEngineBackend::rollbackTransaction ( )
inherited

Rollback the current database transaction

◆ setDbEngineErrorHandler()

void Digikam::BdEngineBackend::setDbEngineErrorHandler ( DbEngineErrorHandler *const  handler)
inherited

Add a DbEngineErrorHandler. This object must be created in the main thread. If a database error occurs, this object can handle problem solving and user interaction.

◆ setForeignKeyChecks()

void Digikam::BdEngineBackend::setForeignKeyChecks ( bool  check)
inherited

Enables or disables FOREIGN_KEY_CHECKS for the database. This function depends on the database engine.

References Digikam::BdEngineBackend::execSql().

◆ status()

BdEngineBackend::Status Digikam::BdEngineBackend::status ( ) const
inherited

Returns the current status of the database backend

◆ tables()

QStringList Digikam::BdEngineBackend::tables ( )
inherited

Returns a list with the names of tables in the database.

◆ transactionErrorHandling()

bool Digikam::BdEngineBackend::transactionErrorHandling ( const QSqlError &  lastError,
int  retries 
)
inherited

Member Data Documentation

◆ d_ptr

BdEngineBackendPrivate* const Digikam::BdEngineBackend::d_ptr
protectedinherited

The documentation for this class was generated from the following files: