Futuresql
threadeddatabase.h
28/// If the required one is not included, use the DatabaseConfiguration::setType QString overload instead.
43 /// Set the name of the database driver. If it is included in DatabaseType, use the enum overload instead
80constexpr bool isQVariantConvertible = std::conjunction_v<std::is_convertible<Args, QVariant>...>;
96 static std::unique_ptr<ThreadedDatabase> establishConnection(const DatabaseConfiguration &config);
113 /// The subdirectories need to be named so that when sorted alphabetically the migrations will be run in the correct order.
122 /// Declare that the database is currently at the state of the migration in the migration subdirectory
125 /// The automatic migrations will then start with all migrations that are newer than migrationName.
127 /// @warning This function should only be used for the initial switch from a different migration system, for example a custom made one.
140 /// and a, if the column types are not the same types in the same order as the attributes of the struct,
161 /// \brief Run a custom function on the database thread. The function is passed the internal QSqlDatabase.
void setDatabaseName(const QString &databaseName)
Set the name of the database (path of the file for SQLite)
Definition threadeddatabase.cpp:303
void setType(const QString &type)
Set the name of the database driver. If it is included in DatabaseType, use the enum overload instead...
Definition threadeddatabase.cpp:276
auto getResults(const QString &sqlQuery, Args... args) -> QFuture< std::vector< T > >
Execute an SQL query on the database, retrieving the result.
Definition threadeddatabase.h:145
static std::unique_ptr< ThreadedDatabase > establishConnection(const DatabaseConfiguration &config)
Connect to a database.
Definition threadeddatabase.cpp:332
auto execute(const QString &sqlQuery, Args... args) -> QFuture< void >
Execute an SQL query on the database, ignoring the result.
Definition threadeddatabase.h:106
auto runOnThread(Func &&func) -> QFuture< std::invoke_result_t< Func, const QSqlDatabase & > >
Run a custom function on the database thread.
Definition threadeddatabase.h:167
auto getResult(const QString &sqlQuery, Args... args) -> QFuture< std::optional< T > >
Like getResults, but for retrieving just one row.
Definition threadeddatabase.h:156
QThread(QObject *parent)
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Jan 24 2025 11:51:54 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Jan 24 2025 11:51:54 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.