diff options
| author | 2021-12-17 07:06:30 -0500 | |
|---|---|---|
| committer | 2021-12-17 07:06:30 -0500 | |
| commit | 1fdc150116cad39aae5c5da407c3312b47a59e3a (patch) | |
| tree | 123c79a4d7ad2d45781ba03ce939f7539fb428d8 /Plugins/DbSqliteSystemData/dbsqlitesystemdatainstance.cpp | |
| parent | feda8a7db8d1d7c5439aa8f8feef7cc0dd2b59a0 (diff) | |
New upstream version 3.3.3+dfsg1.upstream/3.3.3+dfsg1
Diffstat (limited to 'Plugins/DbSqliteSystemData/dbsqlitesystemdatainstance.cpp')
| -rw-r--r-- | Plugins/DbSqliteSystemData/dbsqlitesystemdatainstance.cpp | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/Plugins/DbSqliteSystemData/dbsqlitesystemdatainstance.cpp b/Plugins/DbSqliteSystemData/dbsqlitesystemdatainstance.cpp deleted file mode 100644 index 2295006..0000000 --- a/Plugins/DbSqliteSystemData/dbsqlitesystemdatainstance.cpp +++ /dev/null @@ -1,31 +0,0 @@ -#include "dbsqlitesystemdatainstance.h"
-#include "dbsqlitesystemdata.h"
-
-DbSqliteSystemDataInstance::DbSqliteSystemDataInstance(const QString& name, const QString& path, const QHash<QString, QVariant>& connOptions) :
- AbstractDb3<SystemDataSQLite>(name, path, connOptions)
-{
-}
-
-void DbSqliteSystemDataInstance::initAfterOpen()
-{
- SqlQueryPtr res;
-
- QString key = connOptions[DbSqliteSystemData::PASSWORD_OPT].toString();
- if (!key.isEmpty())
- {
- res = exec(QString("PRAGMA key = '%1';").arg(key), Flag::NO_LOCK);
- if (res->isError())
- qWarning() << "Error while defining WxSqlite3 key:" << res->getErrorText();
- }
-
- AbstractDb3<SystemDataSQLite>::initAfterOpen();
-}
-
-QString DbSqliteSystemDataInstance::getAttachSql(Db *otherDb, const QString &generatedAttachName)
-{
- QString pass = "";
- if (otherDb->getConnectionOptions().contains(DbSqliteSystemData::PASSWORD_OPT))
- pass = otherDb->getConnectionOptions()[DbSqliteSystemData::PASSWORD_OPT].toString().replace("'", "''");
-
- return QString("ATTACH '%1' AS %2 KEY '%3';").arg(otherDb->getPath(), generatedAttachName, pass);
-}
|
