kDB: Knowledge DataBase
|
#include <Store.h>
Public Member Functions | |
Store (const QDir &_storage, int _port=1242) | |
Store (const SectionName &_section, const StoreName &_store, int _port) | |
Store (const StoreName &_store, int _port) | |
QDir | directory () const |
int | port () const |
cres_qresult< void > | startIfNeeded () |
cres_qresult< void > | start () |
cres_qresult< void > | restart (bool _force=false) |
cres_qresult< void > | stop (bool _force=false) |
cres_qresult< void > | erase () |
Connection | createConnection () const |
bool | isControlling () const |
void | detach () |
bool | isRunning () const |
void | autoSelectPort () |
cres_qresult< void > | setConfiguration (const QString &_key, const QString &_value, bool _restart_server=false) |
cres_qresult< void > | setConfiguration (const QList< QPair< QString, QString > > &_value, bool _restart_server=false) |
Static Public Member Functions | |
static QDir | standardDir (const SectionName &_section, const StoreName &_name) |
static QDir | standardDir (const StoreName &_name) |
Represent a postgresql server, allow it to start, stop and create connection to it.
void Store::autoSelectPort | ( | ) |
Attempt to guess the port, it only works if the store has already been started.
Connection Store::createConnection | ( | ) | const |
Create a connection to that store.
void Store::detach | ( | ) |
detach this instance of the store, and release control, i.e., the postgresql database will not be stopped automatically when this object is deleted.
cres_qresult< void > Store::erase | ( | ) |
This will erase all the content of the database.
bool Store::isControlling | ( | ) | const |
cres_qresult< void > Store::setConfiguration | ( | const QList< QPair< QString, QString > > & | _value, |
bool | _restart_server = false ) |
Set the configuration of the postgresql server.
This function start the server if needed (and then stop if it was started this way). Some changes to configuration require the server to be restarted, this can be done if _restart_server is set to true (default is false)
cres_qresult< void > Store::setConfiguration | ( | const QString & | _key, |
const QString & | _value, | ||
bool | _restart_server = false ) |
Set the configuration of server, convenient overload.
|
static |
_section
and _name
from the standard directory. On linux it would be .local/share/auksys/kdb/stores/section/name cres_qresult< void > Store::start | ( | ) |
Starts the store. And takes control of the server, when this object is deleted the server will be stopped.
cres_qresult< void > Store::startIfNeeded | ( | ) |
Starts the store if needed (if the store is already started, the object does not take control of the instance, and it won't be stopped when the object is deleted)
cres_qresult< void > Store::stop | ( | bool | _force = false | ) |
Stop the server (even if it is not controlled!).