|
MT Showcase SDK
|
This class provides a thin wrapper around database connections using QSqlDatabase. More...
#include <DatabaseManager.hpp>
Static Public Member Functions | |
| static QSqlDatabase | connection (const QString &baseConnectionName) |
| Get a thread-specific database connection. More... | |
| static bool | supportsProtocol (const QString &protocol) |
| Check if the given database protocol is supported. More... | |
This class provides a thin wrapper around database connections using QSqlDatabase.
QSqlDatabase objects are created based on a common base connection name. A unique suffix is added to each connection name based on the calling thread. All connection instances with the same base name and calling thread are shared. The returned QSqlDatabase objects must not be passed between threads. This class also assumes that no function calls to QSqlDatabase that are not thread-safe are performed elsewhere.
|
static |
Get a thread-specific database connection.
This function will return a database connection specific to the calling thread. The returned connection must not be used from different threads. This function is thread-safe.
| baseConnectionName | name for the database connection |
|
static |
Check if the given database protocol is supported.
| protocol | protocol to check |