diff options
| author | 2021-12-17 07:06:30 -0500 | |
|---|---|---|
| committer | 2021-12-17 07:06:30 -0500 | |
| commit | 1fdc150116cad39aae5c5da407c3312b47a59e3a (patch) | |
| tree | 123c79a4d7ad2d45781ba03ce939f7539fb428d8 /Plugins/DbSqlite2 | |
| parent | feda8a7db8d1d7c5439aa8f8feef7cc0dd2b59a0 (diff) | |
New upstream version 3.3.3+dfsg1.upstream/3.3.3+dfsg1
Diffstat (limited to 'Plugins/DbSqlite2')
| -rw-r--r-- | Plugins/DbSqlite2/DbSqlite2.pro | 46 | ||||
| -rw-r--r-- | Plugins/DbSqlite2/dbsqlite2.cpp | 43 | ||||
| -rw-r--r-- | Plugins/DbSqlite2/dbsqlite2.h | 31 | ||||
| -rw-r--r-- | Plugins/DbSqlite2/dbsqlite2.json | 8 | ||||
| -rw-r--r-- | Plugins/DbSqlite2/dbsqlite2_global.h | 12 | ||||
| -rw-r--r-- | Plugins/DbSqlite2/dbsqlite2instance.cpp | 11 | ||||
| -rw-r--r-- | Plugins/DbSqlite2/dbsqlite2instance.h | 29 | ||||
| -rw-r--r-- | Plugins/DbSqlite2/package.xml | 10 | ||||
| -rw-r--r-- | Plugins/DbSqlite2/queryexecutorsqlite2delete.cpp | 30 | ||||
| -rw-r--r-- | Plugins/DbSqlite2/queryexecutorsqlite2delete.h | 24 |
10 files changed, 0 insertions, 244 deletions
diff --git a/Plugins/DbSqlite2/DbSqlite2.pro b/Plugins/DbSqlite2/DbSqlite2.pro deleted file mode 100644 index 9873a39..0000000 --- a/Plugins/DbSqlite2/DbSqlite2.pro +++ /dev/null @@ -1,46 +0,0 @@ -#------------------------------------------------- -# -# Project created by QtCreator 2013-04-08T22:41:09 -# -#------------------------------------------------- - -QT -= gui - -include($$PWD/../../SQLiteStudio3/plugins.pri) - -TARGET = DbSqlite2 -TEMPLATE = lib - -DEFINES += DBSQLITE2_LIBRARY - -SOURCES += dbsqlite2.cpp \ - dbsqlite2instance.cpp \ - queryexecutorsqlite2delete.cpp - -HEADERS += dbsqlite2.h\ - dbsqlite2_global.h \ - dbsqlite2instance.h \ - queryexecutorsqlite2delete.h - -LIBS += -lsqlite - -OTHER_FILES += \ - dbsqlite2.json - - - - - - - - - - - - - - - - - - diff --git a/Plugins/DbSqlite2/dbsqlite2.cpp b/Plugins/DbSqlite2/dbsqlite2.cpp deleted file mode 100644 index f5ae6a4..0000000 --- a/Plugins/DbSqlite2/dbsqlite2.cpp +++ /dev/null @@ -1,43 +0,0 @@ -#include "dbsqlite2.h" -#include "dbsqlite2instance.h" -#include "common/unused.h" -#include "db/queryexecutor.h" -#include "queryexecutorsqlite2delete.h" -#include <QFileInfo> - -DbSqlite2::DbSqlite2() -{ -} - -QList<DbPluginOption> DbSqlite2::getOptionsList() const -{ - return QList<DbPluginOption>(); -} - -bool DbSqlite2::init() -{ - sqlite2DeleteStep = new QueryExecutorSqlite2Delete(); - QueryExecutor::registerStep(QueryExecutor::LAST, sqlite2DeleteStep); - return true; -} - -void DbSqlite2::deinit() -{ - QueryExecutor::deregisterStep(QueryExecutor::LAST, sqlite2DeleteStep); - safe_delete(sqlite2DeleteStep); -} - -Db *DbSqlite2::newInstance(const QString &name, const QString &path, const QHash<QString, QVariant> &options) -{ - return new DbSqlite2Instance(name, path, options); -} - -QString DbSqlite2::getLabel() const -{ - return "SQLite 2"; -} - -bool DbSqlite2::checkIfDbServedByPlugin(Db* db) const -{ - return (db && dynamic_cast<DbSqlite2Instance*>(db)); -} diff --git a/Plugins/DbSqlite2/dbsqlite2.h b/Plugins/DbSqlite2/dbsqlite2.h deleted file mode 100644 index cdc6da7..0000000 --- a/Plugins/DbSqlite2/dbsqlite2.h +++ /dev/null @@ -1,31 +0,0 @@ -#ifndef DBSQLITE2_H -#define DBSQLITE2_H - -#include "dbsqlite2_global.h" -#include "plugins/dbpluginstdfilebase.h" -#include "plugins/genericplugin.h" - -class QueryExecutorSqlite2Delete; - -class DBSQLITE2SHARED_EXPORT DbSqlite2 : public GenericPlugin, public DbPluginStdFileBase -{ - Q_OBJECT - SQLITESTUDIO_PLUGIN("dbsqlite2.json") - - public: - DbSqlite2(); - - QString getLabel() const; - bool checkIfDbServedByPlugin(Db* db) const; - QList<DbPluginOption> getOptionsList() const; - bool init(); - void deinit(); - - protected: - Db *newInstance(const QString &name, const QString &path, const QHash<QString, QVariant> &options); - - private: - QueryExecutorSqlite2Delete* sqlite2DeleteStep = nullptr; -}; - -#endif // DBSQLITE2_H diff --git a/Plugins/DbSqlite2/dbsqlite2.json b/Plugins/DbSqlite2/dbsqlite2.json deleted file mode 100644 index cd9f437..0000000 --- a/Plugins/DbSqlite2/dbsqlite2.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "type": "DbPlugin", - "title": "SQLite 2", - "description": "Provides support for SQLite 2.* databases", - "minAppVersion": 30101, - "version": 10006, - "author": "SalSoft" -} diff --git a/Plugins/DbSqlite2/dbsqlite2_global.h b/Plugins/DbSqlite2/dbsqlite2_global.h deleted file mode 100644 index 42b7af8..0000000 --- a/Plugins/DbSqlite2/dbsqlite2_global.h +++ /dev/null @@ -1,12 +0,0 @@ -#ifndef DBSQLITE2_GLOBAL_H -#define DBSQLITE2_GLOBAL_H - -#include <QtCore/qglobal.h> - -#if defined(DBSQLITE2_LIBRARY) -# define DBSQLITE2SHARED_EXPORT Q_DECL_EXPORT -#else -# define DBSQLITE2SHARED_EXPORT Q_DECL_IMPORT -#endif - -#endif // DBSQLITE2_GLOBAL_H diff --git a/Plugins/DbSqlite2/dbsqlite2instance.cpp b/Plugins/DbSqlite2/dbsqlite2instance.cpp deleted file mode 100644 index 6da4e5b..0000000 --- a/Plugins/DbSqlite2/dbsqlite2instance.cpp +++ /dev/null @@ -1,11 +0,0 @@ -#include "dbsqlite2instance.h" - -DbSqlite2Instance::DbSqlite2Instance(const QString& name, const QString& path, const QHash<QString, QVariant>& connOptions) : - AbstractDb2<Sqlite2>(name, path, connOptions) -{ -} - -QString DbSqlite2Instance::getEncoding() -{ - return "UTF-8"; -} diff --git a/Plugins/DbSqlite2/dbsqlite2instance.h b/Plugins/DbSqlite2/dbsqlite2instance.h deleted file mode 100644 index 08ea368..0000000 --- a/Plugins/DbSqlite2/dbsqlite2instance.h +++ /dev/null @@ -1,29 +0,0 @@ -#ifndef DBSQLITE2INSTANCE_H -#define DBSQLITE2INSTANCE_H - -#include "db/abstractdb2.h" -#include "common/global.h" -#include <sqlite.h> - -struct Sqlite2 -{ - static_char* label = "SQLite 2"; -}; - -class DbSqlite2Instance : public AbstractDb2<Sqlite2> -{ - public: - /** - * @brief Creates SQLite database object. - * @param name Name for the database. - * @param path File path of the database. - * @param connOptions Connection options. See AbstractDb for details. - * - * All values from this constructor are just passed to AbstractDb2 constructor. - */ - DbSqlite2Instance(const QString& name, const QString& path, const QHash<QString, QVariant>& connOptions); - - QString getEncoding(); -}; - -#endif // DBSQLITE2INSTANCE_H diff --git a/Plugins/DbSqlite2/package.xml b/Plugins/DbSqlite2/package.xml deleted file mode 100644 index 1b9d726..0000000 --- a/Plugins/DbSqlite2/package.xml +++ /dev/null @@ -1,10 +0,0 @@ -<?xml version="1.0"?>
-<Package>
- <DisplayName>SQLite 2 plugin</DisplayName>
- <Description>Plugin for SQLite 2 databases</Description>
- <Version>%VERSION%</Version>
- <ReleaseDate>%DATE%</ReleaseDate>
- <Name>pl.com.salsoft.sqlitestudio.plugins.dbsqlite2</Name>
- <Dependencies>pl.com.salsoft.sqlitestudio.plugins</Dependencies>
- <Default>true</Default>
-</Package>
\ No newline at end of file diff --git a/Plugins/DbSqlite2/queryexecutorsqlite2delete.cpp b/Plugins/DbSqlite2/queryexecutorsqlite2delete.cpp deleted file mode 100644 index 95ae98e..0000000 --- a/Plugins/DbSqlite2/queryexecutorsqlite2delete.cpp +++ /dev/null @@ -1,30 +0,0 @@ -#include "queryexecutorsqlite2delete.h" -#include "db/sqlquery.h" -#include "parser/ast/sqlitedelete.h" - -bool QueryExecutorSqlite2Delete::exec() -{ - if (db->getVersion() != 2) - return true; - - SqliteQueryPtr lastQuery = context->parsedQueries.last(); - - if (!lastQuery) - return true; - - SqliteDeletePtr deleteQuery = lastQuery.dynamicCast<SqliteDelete>(); - if (!deleteQuery) - return true; - - if (!deleteQuery->where) - { - deleteQuery->where = new SqliteExpr(); - deleteQuery->where->setParent(deleteQuery.data()); - deleteQuery->where->mode = SqliteExpr::Mode::LITERAL_VALUE; - deleteQuery->where->literalValue = 1; - } - - deleteQuery->rebuildTokens(); - updateQueries(); - return true; -} diff --git a/Plugins/DbSqlite2/queryexecutorsqlite2delete.h b/Plugins/DbSqlite2/queryexecutorsqlite2delete.h deleted file mode 100644 index 5d3f478..0000000 --- a/Plugins/DbSqlite2/queryexecutorsqlite2delete.h +++ /dev/null @@ -1,24 +0,0 @@ -#ifndef QUERYEXECUTORSQLITE2DELETE_H -#define QUERYEXECUTORSQLITE2DELETE_H - -#include "db/queryexecutorsteps/queryexecutorstep.h" - -/** - * @brief The QueryExecutorSqlite2Delete class - * - * From SQLite2 documentation: - * - * Because of this optimization, the change count for "DELETE FROM table" will be zero - * regardless of the number of elements that were originally in the table. - * To get an accurate count of the number of rows deleted, use "DELETE FROM table WHERE 1" instead. - * - * This extra step will add "WHERE 1" if there is no WHERE for DELETE query. - * - */ -class QueryExecutorSqlite2Delete : public QueryExecutorStep -{ - public: - bool exec(); -}; - -#endif // QUERYEXECUTORSQLITE2DELETE_H |
