From 3565aad630864ecdbe53fdaa501ea708555b3c7c Mon Sep 17 00:00:00 2001 From: Unit 193 Date: Sun, 30 Apr 2023 18:30:36 -0400 Subject: New upstream version 3.4.4+dfsg. --- SQLiteStudio3/coreSQLiteStudio/schemaresolver.h | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'SQLiteStudio3/coreSQLiteStudio/schemaresolver.h') 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 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 getTableColumnDataTypes(const QString& table, int expectedNumberOfTypes = -1); QList 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& 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 getIndexesWithTables(const QString& database = QString()); + QString normalizeCaseObjectNameByQuery(const QString& query, const QString& name); template StrHash> getAllParsedObjectsForType(const QString& database, const QString& type); -- cgit v1.2.3