DatabaseWrapper.
More...
#include <database.h>
|
QSqlDatabase * | operator-> () noexcept |
| Returns a pointer to the underlying QSqlDatabase instance.
|
|
QSqlDatabase & | operator* () noexcept |
| Returns a reference to the underlying QSqlDatabase instance.
|
|
const QString & | name () const noexcept |
| Returns the name of the database.
|
|
void | open (const std::string &path, const bool explain_err) |
| Opens the database file at the given path.
|
|
void | openNew (const std::string &path) |
| Opens the database file at the given path.
|
|
void | startTransaction (const bool explain_msg, const bool explain_err) |
| Starts an ACID transaction on the database.
|
|
void | commitTransaction (const bool explain_msg, const bool explain_err) |
| Commits an ongoing transaction.
|
|
void | rollbackTransaction (const bool explain_msg, const bool explain_err) |
| Rolls back an ongoing transaction.
|
|
QueryWrapper | getQuery () noexcept |
| Returns an instance of a QueryWrapper associated with the database.
|
|
DatabaseWrapper.
A wrapper around a QSqlDatabase
◆ commitTransaction()
void DatabaseWrapper::commitTransaction |
( |
const bool | explain_msg, |
|
|
const bool | explain_err ) |
Commits an ongoing transaction.
Throws in case of failure
- Exceptions
-
◆ open()
void DatabaseWrapper::open |
( |
const std::string & | path, |
|
|
const bool | explain_err ) |
Opens the database file at the given path.
Throws if the file cannot be opened or if opening fails
- Exceptions
-
◆ openNew()
void DatabaseWrapper::openNew |
( |
const std::string & | path | ) |
|
Opens the database file at the given path.
Used when creating a new database file. Throws if opening fails.
- Exceptions
-
◆ rollbackTransaction()
void DatabaseWrapper::rollbackTransaction |
( |
const bool | explain_msg, |
|
|
const bool | explain_err ) |
Rolls back an ongoing transaction.
Throws in case of failure
- Exceptions
-
◆ startTransaction()
void DatabaseWrapper::startTransaction |
( |
const bool | explain_msg, |
|
|
const bool | explain_err ) |
Starts an ACID transaction on the database.
Throws in case of failure
- Exceptions
-
The documentation for this class was generated from the following files:
- logdoctor/modules/database/database.h
- logdoctor/modules/database/database.cpp