DataGrip 2019.3: MongoDB, debugger, trendy progress bar, many new inspections

Hello! As usual, three times a year we talk about what we worked on. This article is about what's new in DataGrip 2019.3 , and therefore in all JetBrains IDEs with database support.







MongoDB Support



This will be our first publication on Habré, in the comments to which they will not ask: “And when is support for Monga planned?”



Meet me! What works in this version:



Introspection : Collections and fields are displayed in the database explorer. We analyze the first 10 documents from each collection to have an idea of ​​its fields.



If you want to increase this number, specify it in the JDBC parameter fetch_documents_for_metainfo on the Advanced tab in the properties of the data source.







View data : Browse collections in tabular form by page. You can sort by values ​​and use a filter.







Tree View : Specially for MongoDB, we did a tree view of the data. To turn it on, click on the gear, then View as ... | Tree Another such view works for PostgreSQL arrays, and we plan to make it possible to look in JSON and XML fields in the form of a tree.







Query Console : There is currently no support for writing code, but the queries work. To start a query, put a carriage on it and press Ctrl / Cmd + Enter or the Run button on the toolbar.



If you are working in a JavaScript-enabled IDE, requests will be highlighted. We’ll add backlighting to DataGrip later.







PL / SQL Debugger for Oracle



The first version of the long awaited debugger for Oracle. Now he works with procedures, functions, packages, triggers and anonymous blocks.



Remember that the object must be compiled for debugging. To do this, use the context menu: Database tools | Recompile







Check the “With debug” checkbox. If the procedure has already been compiled for debugging, there is a green bug on its icon.







To start the debugger in the console, click the Debug button on the toolbar.







Details about the debugger are in our documentation (in English). Opinions, comments, suggestions, please write here .



Work with source codes



Procedure Code Comparison



Two procedures can be compared by selecting them and pressing Ctrl / Cmd + D. Previously, only signatures were compared, now the source.







Three panel fusion



When you update the source code of an object, DataGrip warns if the code has changed in the database during this time. Now, to resolve conflicts, they will offer you a merge using three panels: on the left you will see your version, on the right - what came from the database, and in the middle - the result of their merger.







To make sure that you don’t rewrite someone else’s code, make sure that the Warn if editing outdated DDL setting is enabled in the data source properties.



Help in writing code



In the source code of objects now help in writing code. For example, you can open an asterisk.







Beautiful source in PostgreSQL



If the pretty-printed setting is disabled, PostgreSQL gives the source with a lot of redundant brackets:







We decided to enable it by default. In our example, there are no brackets left :)







But pay attention to what PostgreSQL writes in its documentation :



Pretty-printed code reads better, but the default format is likely to be better understood by future versions of PostgreSQL. Therefore, we advise against using pretty-printed code for dumps.



The pretty-printed format is more readable, but the default format is more likely to be interpreted the same way by future versions of PostgreSQL; avoid using pretty-printed output for dump purposes.




Running queries



Progress in the editor



Users complained that it was not always clear that the request was still running or was already completed. We added a spinning icon to the left panel and a timer in a text editor.







Planner flame chart



This is a new type of data visualization from the scheduler. To open the flame chart (or flame graph, as you like), click on the button on the left:







Looks like that:







Help in writing code



Inspections



DataGrip will warn you if you:



... use the COALESCE operator unnecessarily: for example, if the first argument is never NULL. You will be prompted to delete the unnecessary code.







... insert NULL into the column for which it is prohibited.







... did not list all the columns in the INSERT clause.







... use the equal operator to compare with NULL. This comparison is false because NULL is "unknown." Since two values ​​that are “unknown” cannot be compared, you must use the special IS NULL statement.







... use the ORDER BY clause in a subquery. This inspection only works in SQL Server.







... use TOP and OFFSET at the same time. This is also an inspection for SQL Server.







Convert Constructions



Comparison with AND can be converted to BETWEEN , and vice versa.







JOIN ON can be converted to JOIN USING , and vice versa.







Text editor



New action: sorting strings alphabetically . It can be useful when working in CSV files or finding duplicates in a list of values. We remind you that you can call any action by Ctrl / Cmd + Shift + A.







We did a search on the selected code fragment. First select the area to search, then press Ctrl / Cmd + F. If you want to search the entire fragment for the entire file, press the key combination again.







Object Filtering



If you use the object filter for the explorer, for example this:







... then the objects that are hidden from the explorer will be considered unknown to the code editor. That is, we assume that if you hid objects from the explorer, then you do not want to work from SQL with them.







Code generation



The Generate menu , which is called by Alt + Ins / Cmd + N , has many new objects: materialized representations, collations, enumerations and more.







Data editor



Now, if the result is columns with the same name, we show which table they are taken from. This is also convenient because these names are used during export: for example, if you create a new table from the result, you will not have a name conflict.







The Modify Table action works from the data editor. For example, if you work with table data and decide to add a column to it, now it is easier to do this: press Ctrl / Cmd + F6 and edit the table.







And one more little feature



You can google the text of the connection error by clicking on the button:







That's all!



- Download trial for a month

- The tweeter we read

- The mail we read: datagrip@jetbrains.com



As always, we are waiting for comments about what we liked and about the most important tickets for you in Jutrek :)



DataGrip Team



All Articles