Akonadi::Server::DbConfig
#include <dbconfig.h>
Public Member Functions | |
virtual void | apply (QSqlDatabase &database)=0 |
virtual QString | databaseName () const =0 |
virtual QString | databasePath () const =0 |
virtual bool | disableConstraintChecks (const QSqlDatabase &db)=0 |
virtual QString | driverName () const =0 |
virtual bool | enableConstraintChecks (const QSqlDatabase &db)=0 |
virtual bool | init (QSettings &settings, bool storeSettings=true, const QString &overrideDbPath={})=0 |
virtual void | initSession (const QSqlDatabase &database) |
virtual bool | isAvailable (QSettings &settings)=0 |
virtual void | setDatabasePath (const QString &path, QSettings &settings)=0 |
virtual void | setup () |
virtual qint64 | sizeThreshold () const |
virtual bool | startInternalServer () |
virtual void | stopInternalServer () |
virtual bool | useInternalServer () const =0 |
Static Public Member Functions | |
static DbConfig * | configuredDatabase () |
static void | destroy () |
static bool | isConfigured () |
Protected Member Functions | |
DbConfig (const QString &configFile) | |
int | execute (const QString &cmd, const QStringList &args) const |
Static Protected Member Functions | |
static QString | defaultAvailableDatabaseBackend (QSettings &settings) |
static QString | defaultDatabaseName () |
Detailed Description
A base class that provides an unique access layer to configuration and initialization of different database backends.
Definition at line 20 of file dbconfig.h.
Constructor & Destructor Documentation
◆ ~DbConfig()
|
virtual |
Definition at line 49 of file dbconfig.cpp.
◆ DbConfig() [1/2]
|
explicitprotected |
Definition at line 28 of file dbconfig.cpp.
◆ DbConfig() [2/2]
|
explicitprotected |
Definition at line 33 of file dbconfig.cpp.
Member Function Documentation
◆ apply()
|
pure virtual |
This method applies the configured settings to the QtSql database
instance.
◆ configuredDatabase()
|
static |
Returns the DbConfig instance for the database the user has configured.
Definition at line 77 of file dbconfig.cpp.
◆ databaseName()
|
pure virtual |
Returns the database name.
◆ databasePath()
|
pure virtual |
Returns path to the database file or directory.
◆ defaultAvailableDatabaseBackend()
Definition at line 58 of file dbconfig.cpp.
◆ defaultDatabaseName()
|
staticprotected |
Returns the suggested default database name, if none is specified in the configuration already.
This includes instance namespaces, so usually this is not necessary to use in combination with internal databases (in process or using our own server instance).
Definition at line 143 of file dbconfig.cpp.
◆ destroy()
|
static |
Destroys the current global DbConfig instance.
The subsequent call to configuredDatabase() will create a new DbConfig from current configuration.
Definition at line 116 of file dbconfig.cpp.
◆ disableConstraintChecks()
|
pure virtual |
Disables foreign key constraint checks.
◆ driverName()
|
pure virtual |
Returns the name of the used driver.
◆ enableConstraintChecks()
|
pure virtual |
Re-enables foreign key constraint checks.
◆ execute()
|
protected |
Calls QProcess::execute() and also prints the command and arguments via qCDebug()
Definition at line 157 of file dbconfig.cpp.
◆ init()
|
pure virtual |
This method is called whenever the Akonadi server is started and before the initial database connection is set up.
At this point the default settings should be determined, merged with the given settings
and written back if storeSettings
is true.
When overrideDbPath is specified, the database will be stored inside this directory instead of the default location.
◆ initSession()
|
virtual |
Do session setup/initialization work on database
.
An example would be to run some SQL commands on every new session, typically stuff like setting encodings, transaction isolation levels, etc.
Definition at line 152 of file dbconfig.cpp.
◆ isAvailable()
|
pure virtual |
This method checks if the requirements for this database connection are met in the system (i.e.
QMYSQL driver is available, mysqld binary is found, etc.).
◆ isConfigured()
|
static |
Returns whether database have been configured.
Definition at line 53 of file dbconfig.cpp.
◆ setDatabasePath()
|
pure virtual |
Set the path to the database file or directory.
◆ setup()
|
virtual |
This method is called to setup initial database settings after a connection is established.
Definition at line 133 of file dbconfig.cpp.
◆ sizeThreshold()
|
virtual |
Payload data bigger than this value will be stored in separate files, instead of the database.
Valid
- Returns
- the size threshold in bytes, defaults to 4096.
Definition at line 138 of file dbconfig.cpp.
◆ startInternalServer()
|
virtual |
This method is called to start an external server.
Definition at line 122 of file dbconfig.cpp.
◆ stopInternalServer()
|
virtual |
This method is called to stop the external server.
Definition at line 128 of file dbconfig.cpp.
◆ useInternalServer()
|
pure virtual |
Returns whether an internal server needs to be used.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 4 2024 16:31:59 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.