mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-10-10 06:04:12 +02:00
fix: harden project database export
Use a bound VACUUM INTO path and remove the stale SQLite handle declaration. Fix shell continuations in Windows CI and Debian installation instructions.
This commit is contained in:
@@ -1290,9 +1290,10 @@ void projectDataBase::exportDb(projectDataBase *db,
|
||||
|
||||
// VACUUM INTO creates a standalone copy of the current database without
|
||||
// requiring access to the SQLite driver's native connection handle.
|
||||
const auto escaped_path = path_.replace("'", "''");
|
||||
QSqlQuery query(db->m_data_base);
|
||||
if (!query.exec("VACUUM INTO '" % escaped_path % "'")) {
|
||||
query.prepare("VACUUM INTO ?");
|
||||
query.bindValue(0, path_);
|
||||
if (!query.exec()) {
|
||||
qWarning() << "Unable to export project database:" << query.lastError().text();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,7 +29,6 @@ class QETProject;
|
||||
class Diagram;
|
||||
class Conductor;
|
||||
class Terminal;
|
||||
class sqlite3;
|
||||
|
||||
/**
|
||||
@brief The projectDataBase class
|
||||
|
||||
Reference in New Issue
Block a user