Akonadi::Server::DbConfig

#include <dbconfig.h>

Inherited by Akonadi::Server::DbConfigMysql, Akonadi::Server::DbConfigPostgresql, and Akonadi::Server::DbConfigSqlite.

Public Member Functions

virtual void apply (QSqlDatabase &database)=0
 
virtual QString databaseName () const =0
 
virtual QString driverName () const =0
 
virtual bool init (QSettings &settings)=0
 
virtual void initSession (const QSqlDatabase &database)
 
virtual void setup ()
 
virtual qint64 sizeThreshold () const
 
virtual bool startInternalServer ()
 
virtual void stopInternalServer ()
 
virtual bool useInternalServer () const =0
 

Static Public Member Functions

static DbConfigconfiguredDatabase ()
 
static bool isConfigured ()
 

Protected Member Functions

int execute (const QString &cmd, const QStringList &args) const
 

Static Protected Member Functions

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 35 of file dbconfig.h.

Member Function Documentation

virtual void Akonadi::Server::DbConfig::apply ( QSqlDatabase database)
pure virtual

This method applies the configured settings to the QtSql database instance.

DbConfig * DbConfig::configuredDatabase ( )
static

Returns the DbConfig instance for the database the user has configured.

Definition at line 65 of file dbconfig.cpp.

virtual QString Akonadi::Server::DbConfig::databaseName ( ) const
pure virtual

Returns the database name.

QString DbConfig::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 124 of file dbconfig.cpp.

virtual QString Akonadi::Server::DbConfig::driverName ( ) const
pure virtual

Returns the name of the used driver.

int DbConfig::execute ( const QString cmd,
const QStringList args 
) const
protected

Calls QProcess::execute() and also prints the command and arguments via qCDebug()

Definition at line 138 of file dbconfig.cpp.

virtual bool Akonadi::Server::DbConfig::init ( QSettings settings)
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.

void DbConfig::initSession ( const QSqlDatabase database)
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 133 of file dbconfig.cpp.

bool DbConfig::isConfigured ( )
static

Returns whether database have been configured.

Definition at line 60 of file dbconfig.cpp.

void DbConfig::setup ( )
virtual

This method is called to setup initial database settings after a connection is established.

Definition at line 114 of file dbconfig.cpp.

qint64 DbConfig::sizeThreshold ( ) const
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 119 of file dbconfig.cpp.

bool DbConfig::startInternalServer ( )
virtual

This method is called to start an external server.

Definition at line 103 of file dbconfig.cpp.

void DbConfig::stopInternalServer ( )
virtual

This method is called to stop the external server.

Definition at line 109 of file dbconfig.cpp.

virtual bool Akonadi::Server::DbConfig::useInternalServer ( ) const
pure virtual

Returns whether an internal server needs to be used.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sat Jun 6 2020 23:09:09 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.