Futuresql
threadeddatabase.cpp
41 if (!query.prepare(QStringLiteral("insert into " SCHAMA_MIGRATIONS_TABLE " (version) values (:name)"))) {
52 query.prepare(QStringLiteral("select version from " SCHAMA_MIGRATIONS_TABLE " order by version desc limit 1"));
67 const auto entries = dir.entryList(QDir::Filter::Dirs | QDir::Filter::NoDotAndDotDot, QDir::SortFlag::Name);
109 qCWarning(asyncdatabase) << "Stopping migrations here, as the next migration may depens on this one.";
155 auto AsyncSqlDatabase::setCurrentMigrationLevel(const QString &migrationName) -> QFuture<void> {
225 std::optional<QSqlQuery> AsyncSqlDatabase::prepareQuery(const QSqlDatabase &database, const QString &sqlQuery)
328 std::unique_ptr<ThreadedDatabase> ThreadedDatabase::establishConnection(const DatabaseConfiguration &config) {
341 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:337
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:272
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:341
void quit()
QSqlDatabase addDatabase(const QString &type, const QString &connectionName)
KSharedConfigPtr config()
void setDatabaseName(const QString &databaseName)
Set the name of the database (path of the file for SQLite)
Definition: threadeddatabase.cpp:299
static std::unique_ptr< ThreadedDatabase > establishConnection(const DatabaseConfiguration &config)
Connect to a database.
Definition: threadeddatabase.cpp:328
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:287
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 Wed Sep 27 2023 03:47:03 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2023 The KDE developers.
Generated on Wed Sep 27 2023 03:47:03 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.