Playground mode is now the default for query consoles. It works best if your file is just a set of unconnected queries, independent of each other and having no particular sequence – kind of like a playground. In Playground mode, DataGrip resolves objects according to the context (which is the value in the schema chooser, the resolution scope, or, if none of those is set, the default database). To address this situation, we’re created a way for DataGrip to know which approach to follow, by introducing two resolve modes: Playground and Script. In other words, if there are no USE/SET SEARCH PATH statements in your file, then DataGrip shouldn’t try to resolve the beginning of the file somewhere out of context. So, it treated the default database/schema (or the entry from the SQL Resolution scopes setting, if one was provided) as the most appropriate context for the beginning of the file. However, the IDE needs to know where to resolve right from the beginning of the file, too. This was fine for working with scripts containing USE/SET SEARCH PATH statements, which switch the context. The cause of these and other issues was that, for each console or local file, DataGrip resolved their objects to the context (selected in the top right-hand drop-down) and the default database/schema (or the entry from the SQL Resolution scopes setting, if one was provided). If there were multiple objects with the same name in different databases/schemas, existing columns would fail to be resolved (or vice versa, there was a risk of resolving non-existing columns), and even the Expand column list action would sometimes generate the wrong list.When the Auto-qualify option was turned on, the objects would sometimes stay unqualified if they were located in the default database/schema.All the objects were resolved, but the script could not be run in the database.This is why there were, until recently, several resolve-related problems. In general, the resolve context should match the running context, but that is not a trivial task for DataGrip to handle. This is necessary for the IDE to provide you with correct code completion and treat the usages of the objects as links. Resolving database objects in SQL scripts takes an understanding of what the objects mean. Let’s take a closer look at what’s inside. DataGrip 2022.2 EAP build #2 is available.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |