LibrePCB Developers Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SQLiteDatabase Class Referencefinal

The SQLiteDatabase class. More...

#include <sqlitedatabase.h>

Inherits QObject.

+ Collaboration diagram for SQLiteDatabase:

Classes

class  TransactionScopeGuard
 

Public Member Functions

 SQLiteDatabase ()=delete
 
 SQLiteDatabase (const SQLiteDatabase &other)=delete
 
 SQLiteDatabase (const FilePath &filepath)
 
 ~SQLiteDatabase () noexcept
 
void beginTransaction ()
 
void commitTransaction ()
 
void rollbackTransaction ()
 
void clearTable (const QString &table)
 
QSqlQuery prepareQuery (const QString &query) const
 
int insert (QSqlQuery &query)
 
void exec (QSqlQuery &query)
 
void exec (const QString &query)
 
SQLiteDatabaseoperator= (const SQLiteDatabase &rhs)=delete
 

Private Member Functions

void enableSqliteWriteAheadLogging ()
 Enable the "Write-Ahead Logging" (WAL) featur of SQLite. More...
 
QHash< QString, QString > getSqliteCompileOptions ()
 Get compile options of the SQLite driver library. More...
 

Private Attributes

QSqlDatabase mDb
 

Detailed Description

The SQLiteDatabase class.

Author
ubruhin
Date
2016-09-03

Constructor & Destructor Documentation

SQLiteDatabase ( )
delete
SQLiteDatabase ( const SQLiteDatabase other)
delete
SQLiteDatabase ( const FilePath filepath)

+ Here is the call graph for this function:

~SQLiteDatabase ( )
noexcept

Member Function Documentation

void beginTransaction ( )

+ Here is the caller graph for this function:

void commitTransaction ( )
void rollbackTransaction ( )
void clearTable ( const QString &  table)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

QSqlQuery prepareQuery ( const QString &  query) const

+ Here is the caller graph for this function:

int insert ( QSqlQuery &  query)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void exec ( QSqlQuery &  query)

+ Here is the caller graph for this function:

void exec ( const QString &  query)

+ Here is the call graph for this function:

SQLiteDatabase& operator= ( const SQLiteDatabase rhs)
delete
void enableSqliteWriteAheadLogging ( )
private

Enable the "Write-Ahead Logging" (WAL) featur of SQLite.

Note
LibrePCB requires to enable WAL to avoid blocking readers by writers. If not enabled, the library scanner would also block all read-only accesses to the library database.
See Also
http://www.sqlite.org/wal.html

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

QHash< QString, QString > getSqliteCompileOptions ( )
private

Get compile options of the SQLite driver library.

Returns
A hashmap of all compile options (without the "SQLITE_" prefix)
See Also
https://sqlite.org/pragma.html#pragma_compile_options

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Member Data Documentation

QSqlDatabase mDb
private

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