Futuresql
threadeddatabase.cpp
38 if (!query.prepare(QStringLiteral("insert into " SCHAMA_MIGRATIONS_TABLE " (version) values (:name)"))) {
49 query.prepare(QStringLiteral("select version from " SCHAMA_MIGRATIONS_TABLE " order by version desc limit 1"));
61 const auto entries = dir.entryList(QDir::Filter::Dirs | QDir::Filter::NoDotAndDotDot, QDir::SortFlag::Name);
144 auto AsyncSqlDatabase::setCurrentMigrationLevel(const QString &migrationName) -> QFuture<void> {
304 std::unique_ptr<ThreadedDatabase> ThreadedDatabase::establishConnection(const DatabaseConfiguration &config) {
317 auto ThreadedDatabase::setCurrentMigrationLevel(const QString &migrationName) -> QFuture<void> {
auto runMigrations(const QString &migrationDirectory) -> QFuture< void >
Run the database migrations in the given directory.
Definition: threadeddatabase.cpp:313
std::optional< QSqlQuery > query(const QString &queryStatement)
bool isValid() const const
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:248
ReadOnly
QString fromUtf8(const char *str, int size)
Type type(const QSqlDatabase &db)
QChar separator()
bool rollback()
bool wait(QDeadlineTimer deadline)
auto setCurrentMigrationLevel(const QString &migrationName) -> QFuture< void >
Declare that the database is currently at the state of the migration in the migration subdirectory mi...
Definition: threadeddatabase.cpp:317
void quit()
QSqlDatabase addDatabase(const QString &type, const QString &connectionName)
void setDatabaseName(const QString &databaseName)
Set the name of the database (path of the file for SQLite)
Definition: threadeddatabase.cpp:275
static std::unique_ptr< ThreadedDatabase > establishConnection(const DatabaseConfiguration &config)
Connect to a database.
Definition: threadeddatabase.cpp:304
KIOFILEWIDGETS_EXPORT QString dir(const QString &fileClass)
const char * name(StandardAction id)
bool commit()
const QString & type() const
Get the name of the database driver.
Definition: threadeddatabase.cpp:263
bool transaction()
QSqlDatabase database(const QString &connectionName, bool open)
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Sat Apr 1 2023 03:55:59 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2023 The KDE developers.
Generated on Sat Apr 1 2023 03:55:59 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.