diff options
| author | 2023-04-30 18:31:18 -0400 | |
|---|---|---|
| committer | 2023-04-30 18:31:18 -0400 | |
| commit | 4de57f628bc74f00ba1885e91c84ea07c5405d8f (patch) | |
| tree | 5d91900751e826d491ff1b2ebc571a787e84f864 /SQLiteStudio3/coreSQLiteStudio/schemaresolver.h | |
| parent | 74d881cefa9097e58e129e37b9c44d680d8c7dfe (diff) | |
| parent | 3565aad630864ecdbe53fdaa501ea708555b3c7c (diff) | |
Update upstream source from tag 'upstream/3.4.4+dfsg'
Update to upstream version '3.4.4+dfsg'
with Debian dir 482614bd23f0ef52dabc9803477204ad88e917ed
Diffstat (limited to 'SQLiteStudio3/coreSQLiteStudio/schemaresolver.h')
| -rw-r--r-- | SQLiteStudio3/coreSQLiteStudio/schemaresolver.h | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/SQLiteStudio3/coreSQLiteStudio/schemaresolver.h b/SQLiteStudio3/coreSQLiteStudio/schemaresolver.h index e7bf2c8..cfb5bd5 100644 --- a/SQLiteStudio3/coreSQLiteStudio/schemaresolver.h +++ b/SQLiteStudio3/coreSQLiteStudio/schemaresolver.h @@ -15,6 +15,7 @@ #include "db/db.h" #include "common/strhash.h" #include "common/expiringcache.h" +#include "parser/ast/sqlitequerytype.h" #include <QStringList> class SqliteCreateTable; @@ -110,6 +111,7 @@ class API_EXPORT SchemaResolver /** * @brief getTableColumns Get column names for a table. * @param table Table to query. + * @param onlyReal If true, the method will skip columns that are not real (like GENERATED columns). * @return List of column names of the table. * This does something similar to getting list of columns with * PRAGMA table_info(), but the pragma in Sqlite2 doesn't support @@ -117,16 +119,17 @@ class API_EXPORT SchemaResolver * to make this possible. It finds table's DDL and parses it, * then extracts list of columns from parsing results. */ - QStringList getTableColumns(const QString& table); + QStringList getTableColumns(const QString& table, bool onlyReal = false); /** * @brief getTableColumns Get column names for a table. * @param database Attached database name. * @param table Table to query. + * @param onlyReal If true, the method will skip columns that are not real (like GENERATED columns). * @return List of column names of the table. * @overload */ - QStringList getTableColumns(const QString& database, const QString& table); + QStringList getTableColumns(const QString& database, const QString& table, bool onlyReal = false); QList<DataType> getTableColumnDataTypes(const QString& table, int expectedNumberOfTypes = -1); QList<DataType> getTableColumnDataTypes(const QString& database, const QString& table, int expectedNumberOfTypes = -1); @@ -178,6 +181,7 @@ class API_EXPORT SchemaResolver QString getSqliteAutoIndexDdl(const QString& database, const QString& index); static QString getSqliteMasterDdl(bool temp = false); static QStringList getFkReferencingTables(const QString& table, const QList<SqliteCreateTablePtr>& allParsedTables); + static ObjectType objectTypeFromQueryType(const SqliteQueryType& queryType); QStringList getCollations(); @@ -187,6 +191,9 @@ class API_EXPORT SchemaResolver bool getNoDbLocking() const; void setNoDbLocking(bool value); + QString normalizeCaseObjectName(const QString& name); + QString normalizeCaseObjectName(const QString& database, const QString& name); + static QString objectTypeToString(ObjectType type); static ObjectType stringToObjectType(const QString& type); static void staticInit(); @@ -204,6 +211,7 @@ class API_EXPORT SchemaResolver QString getObjectDdlWithDifficultName(const QString& dbName, const QString& lowerName, QString targetTable, ObjectType type); QString getObjectDdlWithSimpleName(const QString& dbName, const QString& lowerName, QString targetTable, ObjectType type); StrHash<QString> getIndexesWithTables(const QString& database = QString()); + QString normalizeCaseObjectNameByQuery(const QString& query, const QString& name); template <class T> StrHash<QSharedPointer<T>> getAllParsedObjectsForType(const QString& database, const QString& type); |
