Torc  0.1
Public Member Functions | Protected Member Functions | List of all members
TorcSQLiteDB Class Reference

SQLite implementation of TorcDB. More...

#include <torcsqlitedb.h>

Inheritance diagram for TorcSQLiteDB:
[legend]

Public Member Functions

 TorcSQLiteDB (const QString &DatabaseName)
 
- Public Member Functions inherited from TorcDB
 TorcDB (const QString &DatabaseName, const QString &DatabaseType)
 
virtual ~TorcDB ()
 
bool IsValid (void)
 Returns true if the datbase has been opened/created. More...
 
void CloseThreadConnection (void)
 Close the database connection for the current thread. More...
 
void LoadSettings (QMap< QString, QString > &Settings)
 Retrieve all persistent settings stored in the database. More...
 
void SetSetting (const QString &Name, const QString &Value)
 Set the setting Name to the value Value. More...
 

Protected Member Functions

bool InitDatabase (void) override
 Create and/or open an SQLiteDatabase. More...
 
- Protected Member Functions inherited from TorcDB
QString GetThreadConnection (void)
 Retrieve a database connection for the current thread. More...
 
void CloseConnections (void)
 Close all cached database connections. More...
 

Additional Inherited Members

- Static Protected Member Functions inherited from TorcDB
static bool DebugError (QSqlQuery *Query)
 Log database errors following a failed query. More...
 
static bool DebugError (QSqlDatabase *Database)
 Log database errors following database creation. More...
 
- Protected Attributes inherited from TorcDB
bool m_databaseValid
 
QString m_databaseName
 
QString m_databaseType
 
QMutex m_lock
 
QHash< QThread *, QString > m_connectionMap
 

Detailed Description

SQLite implementation of TorcDB.

All Sql specific code resides in TorcDB. TorcSQLiteDB applies SQLite specifics when creating the database and upon first use after startup.

Note
The SQLite database is not locked as this prevents access from all threads. This is not best practice and can lead to strange behaviour if two instances of Torc open the same database.
See also
TorcDB

Definition at line 6 of file torcsqlitedb.h.

Constructor & Destructor Documentation

TorcSQLiteDB::TorcSQLiteDB ( const QString &  DatabaseName)
explicit

Definition at line 42 of file torcsqlitedb.cpp.

Member Function Documentation

bool TorcSQLiteDB::InitDatabase ( void  )
overrideprotectedvirtual

Create and/or open an SQLiteDatabase.

Implements TorcDB.

Definition at line 51 of file torcsqlitedb.cpp.


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