📜 ⬆️ ⬇️

DataGrip release 2016.2: CSV import, JSON and XML support in rows, dynamic SQL, improvements for PostgreSQL

Hello! We have time releases. This is a post about what is interesting in the new version of DataGrip - our IDE for SQL. These changes also concern IntelliJ IDEA , PyCharm , PhpStorm and RubyMine - those tools from JetBrains that have database support.

image

Here is what we added:
')


CSV import


The old way was uncomfortable . We have added an interface for importing - now select the item Iport from file ... from the context menu of the data source, specify the path to the file and go ahead.

A dialog box opens in which there are options for describing the file structure — the separator used, quotation marks, the presence of headers, etc. In the right-hand part, specify the field types and other characteristics of the table containing the data. Using the Delete key, you can delete columns from the creation script of this table. If errors occur during import, the process will not stop, and error information will be recorded in a text file - in the lower part of the window, specify where to create it.



Choice of schemes


Schemes that you see in the database window, now choose directly from the tree. There are no more data source properties in the Schemas tab. Remember that the console only knows about objects from this tree.



Language support in string literals


You can assign a string literal to a specific language and use the IDE's features for working with it — highlighting, autocompletion, and others. This can be JSON , XML , regular expressions, or any SQL dialect.
When DataGrip understands that the field contains JSON data or XML - support is performed automatically.

Let's say we insert a value in a JSON type field.



If you specify a value for the default field, the same thing happens - here the IDE realized that you were using XML , and the possibilities for working with this language became available. This is the renaming of elements, the search for occurrences, the movement of elements in hand, etc. Do not forget to look at the XML support documentation page in our tools.



By default, only two types are built in for which languages ​​are automatically supported, JSON and XML. But if you have a data type for which you want to have the same thing, then select Inject by Type from the Alt + Enter prompt menu.



The example uses the CUSTOMDATA type, but, let's say, we always use XML for types whose name ends with DATA . The name of the types for which automatic support will be performed is described in the regular expression (? I). * DATA. On the fly, you can check if one or another string matches the pattern, in this case, the name of your type.



Type name templates for language support in literals fall into Settings / Preferences → Editor → Language Injections.



You can now check the string against the regular expression anywhere. On Alt + Enter select the appropriate language, and then again on Alt + Enter select Check Regexp.



Another way to tell a medium about a language in a string literal is a comment of the form language =% name% . In the following example, dynamic SQL is used — autocompletion and navigation have worked inside the line: the environment has understood which objects are used in the request within the line.



Spreadsheet Editor


For values ​​inside the table, we added an addition by the values ​​in the field, which is called by Ctrl (Cmd) + Space. This resembles an already existing type of add-on, which is called by Alt + / - it searches for all the words used in all open files.



Specific improvements for PostgreSQL : you can edit range fields.



And fields with time zones.



Column size is now changed by Ctrl (Cmd) + Shift + Left / Right . Highlight all columns by Shift + Space , as in Excel.



Console


Like all other development environments on the IntelliJ platform, we now support ligatures. To do this, they must support the font itself, which you install. These can be FiraCode , Hasklig , Monoid or PragmataPro .



It turns out that:



A nice feature for those who use several languages, that is, for you and me: autocompletion will help if you forgot to switch the layout.



Surround with function appeared in the Surround with ( Ctrl / Cmd + Alt + T ) menu - the selected expressions will be taken in brackets, and the cursor will be placed in front of the first bracket. Previously, this thing did not work with multi-cursor, now everything is fine.



For PostgreSQL, we supported the search path - add and remove charts from the menu at the top of the console.



Connection


In the connection window, the addition of names in the server, instance and database fields now works.



Last time, there were a lot of comments about problems with connecting to SQL Server . We have written a small guide on how to solve basic problems with this.

Recompiling Packages in Oracle


The corresponding item is added in the context menu, and only those packages that need it can be recompiled. To do this, select Invalid objects only.



Export schema


Now you can export all schema or selected tables at once. We started work on integrating DataGrip with the external pg_dump and mysqldump tools, so write your wishes in the comments!



Images as IDE background


In the Find Action menu (Ctrl (Cmd) + Shift + A), find Set Background Image or select the corresponding item from the context menu of the image file. Then adjust the transparency and other background settings. This has appeared in all IDEs on the IntelliJ platform.



If you want to learn more, welcome to the What's new page, and do not forget to look at Features , then suddenly something did not know?

We will be glad if you try DataGrip 2016.2 and tell us about your impressions while we are preparing the first minor update.

DataGrip command.

Source: https://habr.com/ru/post/306152/


All Articles