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/completionhelper.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/completionhelper.h')
| -rw-r--r-- | SQLiteStudio3/coreSQLiteStudio/completionhelper.h | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/SQLiteStudio3/coreSQLiteStudio/completionhelper.h b/SQLiteStudio3/coreSQLiteStudio/completionhelper.h index 8df1912..3cff8ec 100644 --- a/SQLiteStudio3/coreSQLiteStudio/completionhelper.h +++ b/SQLiteStudio3/coreSQLiteStudio/completionhelper.h @@ -64,7 +64,10 @@ class API_EXPORT CompletionHelper : public QObject DELETE_WHERE, CREATE_TABLE, CREATE_TRIGGER, - EXPR + EXPR, + INSERT_RETURNING, + UPDATE_RETURNING, + DELETE_RETURNING }; static void initFunctions(Db* db); @@ -125,6 +128,10 @@ class API_EXPORT CompletionHelper : public QObject void extractPreviousIdTokens(const TokenList& parsedTokens); void extractQueryAdditionalInfo(); void extractSelectAvailableColumnsAndTables(); + void extractInsertAvailableColumnsAndTables(); + void extractDeleteAvailableColumnsAndTables(); + void extractUpdateAvailableColumnsAndTables(); + void extractAvailableColumnsAndTables(const QString& database, const QString& table); bool extractSelectCore(); SqliteSelect::Core* extractSelectCore(SqliteQueryPtr query); void extractTableAliasMap(); @@ -135,6 +142,9 @@ class API_EXPORT CompletionHelper : public QObject bool isInDeleteWhere(); bool isInCreateTable(); bool isInCreateTrigger(); + bool isInUpdateReturning(); + bool isInDeleteReturning(); + bool isInInsertReturning(); bool isIn(SqliteQueryType queryType, const QString& tokenMapKey, const QString &prefixKeyword); bool isInExpr(); bool testQueryToken(int tokenPosition, Token::Type type, const QString& value, Qt::CaseSensitivity cs = Qt::CaseInsensitive); @@ -231,6 +241,20 @@ class API_EXPORT CompletionHelper : public QObject QSet<SelectResolver::Table> selectAvailableTables; /** + * @brief theFromAvailableColumns + * Available columns are columns that can be selected basing on what tables are mentioned in FROM clause + * of queries other than SELECT (so INSERT, UPDATE, DELETE), in their RETURNING clause. + */ + QList<SelectResolver::Column> theFromAvailableColumns; + + /** + * @brief theFromAvailableTables + * Availble tables are tables mentioned in FROM clause of queries other than SELECT (so INSERT, UPDATE, DELETE), + * in their RETURNING clause. + */ + QSet<SelectResolver::Table> theFromAvailableTables; + + /** * @brief parentSelectCores * List of all parent select core objects in order: from direct parent, to the oldest parent. */ |
