diff options
| author | 2023-04-30 18:30:36 -0400 | |
|---|---|---|
| committer | 2023-04-30 18:30:36 -0400 | |
| commit | 3565aad630864ecdbe53fdaa501ea708555b3c7c (patch) | |
| tree | c743e4ad0bad39ebdb2f514c7cc52d34a257ebbe /SQLiteStudio3/coreSQLiteStudio/completionhelper.h | |
| parent | 1fdc150116cad39aae5c5da407c3312b47a59e3a (diff) | |
New upstream version 3.4.4+dfsg.upstream/3.4.4+dfsg
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. */ |
