DataGrip 2017.1 Released!

Hello!  From this post you’ll find out what’s new in DataGrip 2017.1.

DataGrip_20171@2x_splash

It is a long read, so let’s begin with the table of contents.

Database tree: New schema management, SQL resolution scopes; Create database/schema UI; Color settings affects editor and grid.

Import/export data: Column mappings and DDL preview; Drag-n-drop tables; Export result-set to a database.

Query Console: Respecting the default search path in PostgreSQL; Trigger generation pattern; Insert string concatenation on Enter option;  Settings for Qualifying objects and more.

Database objects: Double-cliсk opening of column details in Modify table; Warning if object has been changed in another place.

Miscellaneous: Query time and column/row numbers in data editor status bar; Including/excluding text occurrences in Find Usages; Windows authentication for SQL Server in jTDS driver and more.

Below come the details.

Database tree

New schema management

Now the schema selection UI is a tree with the ability to choose if you want to introspect the current schema/database or, all schemas/databases. The  ‘Schemas…’ node in the database view will also show this tree.

00-—-SchemasPopup

The Schemas tab comes back to the data source properties dialog. We added the Pattern field, where you can describe what you want to be introspected. The Ctrl+Q (Ctrl+J for OSX) shortcut will give you information about the syntax.

03-—-NewSchemaManagement

SQL resolution scopes

As you know, DataGrip resolves objects from SQL code to your database. It means that the IDE understands which particular object you use in your script and provides navigation, code completion, and everything else that we are proud of. But previously this process incurred some difficulties if objects in code were unqualified. For instance, if your script contained just table names without schemas or databases, and there were two identical data sources, test and production, then the situation would become confusing.

04 — SQLResoultionScopes

Now, you can simply map any file or folder to any datasource in Settings → Database → SQL resolution scopes. This means that all unqualified objects will be resolved to the selected datasource/database/schema. The project level mappings are the same as Options → Resolved unqualified references in previous versions.

Create database/schema UI

Many of you asked us to implement some simple UI for creating schemas and databases. Voila!

01 — AddSchema

Decide if you want these new schemas and databases to be introspected immediately. This also applies to creating and deleting schemas/databases from the query console.

02 — TrackCreation

NB! As we still do not support several databases for PostgreSQL, any database created in this UI will not appear in the database tree, even if this option is enabled. Please create another data source to manage your new database.

New options in color settings

Data Source color (Context menuColor settings) now affects the console and result tab toolbars. It can even be applied to the editor and grid as well. We hope this will help you avoid running test scripts on your production databases.

05 — ColorSettings

SQLite better introspection

We introduced a small database tree improvement for SQLite users. In earlier versions, we used the introspection provided by JDBC-driver for SQLite. As a result, many objects were absent in the database tree and some source codes were incorrect. Now we show triggers, expression indexes, partial indexes and check constraints.

06 — SQliteIntroscpetion

Import/export data

Import dialog enhancements

We’ve been asked to make the import process more flexible. It frequently happens that the number of columns in a .csv file is not the same as in the target table. Or you just want to import several columns from a file, but not all of them. Now it’s possible to map every column of the file being imported to a table column in your database, which can be either an existing table or a new one created during the import process. Of course, completion works for column names.

01 — ImportMappings

Another new thing in this window is a DDL preview tab, showing you the code to be executed for creating or changing the table.

02 — ImportDDL

Export/import tables

Now there is an easy way to export tables and their data from one database/schema to another. It works even if the tables are in different databases from different vendors. For example, if you need to copy a table from a PostgreSQL database to a SQL Server database, just drag-n-drop it. Check if all is OK in the Import table window and go ahead!

03 — DragnDropTables

The same for the result-set! We added the Export to database buttonChoose any schema in the list and go ahead: the new table is created, the data is inserted.

04 — ExportResultSet

Query console

Respect the default search path

Here is the most important point for PostgreSQL users: now DataGrip respects the default search path. Before, we set the search path according to the context of the console opening. At some point we discovered it wasn’t very convenient for many of you. Now the default search path is set for any console. Change it in any moment or go back to the default one.

00 — SearchPath

Better triggers support

A trigger template has been added to the Generate menu, which is invoked with Ctrl+N (Cmd+O for OSX).

01 — GenerateTrigger

The IDE supports NEW/OLD and INSERTED/UPDATED tables when creating or editing triggers. This means you can use completion for these tables’ columns as well.

02 — TriggerInserted

Code assistance

Try enabling Settings → Editor → Appearance → Show parameter name hints: DataGrip will prompt you about column names in INSERT statements.

03 — ValueHints

We’ve added an SQL section to Settings → Editor → Smart Keys.

05 — QualifyOnColllisions

The Insert string concatenation on Enter option lets you choose if you actually need this. It was the default option before, and it works like this:

EnterWithConcat (2)

But the majority of database management systems support multiline string literals, so this IDE behavior may be annoying. Uncheck the option if you use multiline literals.

EnterWithoutConcat

Qualify object in completion is also a thing we’ve been asked to implement. There are three options and here’s how they work. Suppose we have two schemas, max and public:

04 — QualifyIntroscpector

The table persons is present in both schemas and the table cardvendors is only in max. Here is the example Qualify on collisions:

06 — QualCollisions
Named parameters of routines can be completed by using second completion (pressing Ctrl+Space twice):

07 — ParametersNAmedCompletion

Aliases casing can now be set in Settings Editor Code style SQL. Aliases are offered in code completion.

08 — AliasCasing

The general platform setting in Settings → Editor → Appearance → Show method separator now draws a line between statements.

09 — StatementSeparators

An amusing feature for MySQL: due to errors in the MySQL grammar, a database cannot run queries with some combinations of parenthesis and UNION’s. Now DataGrip can handle these situations.

13 — UnionError

Jump to colors and fonts

A small helpful action is available to those who don’t want to wade through colors and fonts settings to find a single thing they need. For now it is only present in the Find Action menu (Ctrl/Cmd+Shift+A), but as usual, you can assign any shortcut to it.

10 — FindActionText

This action will navigate you to the settings which are relevant to the context under the caret. If there are several of them, just choose one.

11 — JumpToStringToken

Here you are!

12 — StringTokenPrefs

 

Database objects

Modify table UI improvement

The column details in the Modify Table dialog are now opened by double-cliсk.  We changed it based on your negative feedback on single-click opening.

02 — ModifyTable

Tracking source code changes

Sometimes you make changes to the source code of some object, but forget to apply them. As you may know, DataGrip will detect and indicate this with colored marks on the gutter. If you modify such an object in some other place in DataGrip, the source code editor will alert you.

01 — LocalChanges

Documentation link for system tables in PostgreSQL

The quick info pop-up (Ctrl+J) for PostgreSQL system tables now contains the link to the documentation page at postgresql.org.

03 — PgDocument

SQLite views

Also, now DataGrip loads the correct source code for views in SQLite. Before it was the ‘CREATE table’ code.

04 — ViewSQlite

Miscellaneous

More information in result-set status bar

Some information was added to the status bar of the data editor. It is query time and selected column/row numbers under the cursor.

01 — QueryTime

Text occurrences in Find Usages

Also, we have the new option to include or exclude text occurrences in Find Usages.

02 — FindUsagesOptions

If it’s selected, the results will include comments, occurrences in text files, and string literals.

03 — UsagesOfText

Other

— Windows authentication for SQL Server in the jTDS driver.
— Correct line endings are sent to the database in SQL Server.
— Support of the CREATE/ALTER construction from SQL Server 2016. 
TNS names are correctly parsed from tnsnames.ora file in Oracle.
— It’s possible to use routine parameters in LIMIT in MySQL.
— Commit triggers synchronization in PostgreSQL.
— Single quotation mark is now escaped in DDL.
— Read-only preview is available for large files.
— Warnings are added on the Output tab as soon as they’re raised.
Zero-latency typing is now enabled by default.
— Icons for synonyms are displayed in the structure view and completion.
— Customized colors are used for syntax highlighting of regular expressions.

If it’s not the first post you read in this blog, you already know all the information below, but still:

— Get your 30-day trial of DataGrip here.
Tweet at us!
Discuss anything in forum.
— Report bugs to our issue tracker.

Thank you for your attention!
Your DataGrip Team
_
JetBrains
The Drive to Develop

This entry was posted in Releases and tagged , , , , . Bookmark the permalink.

34 Responses to DataGrip 2017.1 Released!

  1. jordan says:

    Great job guys! Is this release included within intellij ultimate?

  2. Pingback: DataGrip 2017.1 Released | Ace Infoway

  3. wang says:

    can it support pl/sql Oracle?

  4. Tufan Özduman says:

    …”better trigger support” is not available for mysql?

  5. Peter says:

    mmmmm… Now he doesn’t update the “list” of tables in the system (MSSQL). Introspecting returns no errors but it doesn’t add the table to auto-complete (for example).
    Let’s see if I can go back to the 2016 version…

  6. Growiel says:

    Is this going to be ported to PHPStorm ?

  7. Jonatas Sas says:

    Hi Maksim, how are you?

    Can I use DataGrip with PhpStorm? What I mean is: I have a PhpStorm project and I want my DB informations to be shared with DataGrip (It’s not a good thing to duplicate the configurations). Is this possible? If not, is something like this in the roadmap?

    • René says:

      This would be a great feature.

      But I am using it the other way around.

      • Maksim Sobolevskiy says:

        Hi! Now you cannot share datasources between different IDE’s.

        But you can share datasources between projects in one IDE.
        If you want to port datasoucres from, say, DataGrip to PhpStorm, you can do this by copying datasource folder. But then, again, they won’t be synchronized.

  8. Cristiano Paiola says:

    Is it possible to debug postgresql functions ?

  9. Fabio says:

    I would like to have the same super easy UI as Sequel Pro combined with DataGrip extra features.

  10. Ben says:

    Why have i now lost most of my Live Templates? and some recent consoles etc? Is there anyway to downgrade and get all my settings, live templates and files back?

    • Ben says:

      Overnight its also completely forgotten about one of the files i created in the show history dialog even though its still open in the editor. I’m missing all the live templates i created yesterday and no longer have an entire console worth of queries anywhere in the entire project or scratch files.

      If i use toolbox to revert is there any chance this will all reappear? Its literally an entire days work gone for no reason with no history.

  11. Richard Haber says:

    I cannot find how to edit existing routines (stored procedures) in mySql that were created with 2016. Double clicking on the routine name now generates a new routine stub instead of opening it for editing. I’ve right clicked everywhere and opened every menu and pressed every button looking for where it is hiding.

    Could somebody help me find out how I can edit my existing routines in 2017.1?

    Thanks

    • Maksim Sobolevskiy says:

      Can you please send a screenshot? It should generate CREATE script of this routine by doucle-click

      • Richard Haber says:

        It generates a CREATE script, but it is a new one, not the existing script with all of the existing code. I am trying to edit an existing script.

        This is what is in the editor.
        — auto-generated definition
        create procedure Outlet.getAllRoyalties ()
        ;

        Why would I want to create a new script by double-clicking on an existing one. I can avoid double clicking, if this is the way it’s supposed to be, but how to I get to editing and exist script. I see no way to do this.

        I would like to include screenshots, but there seems to be no way to paste them here

  12. Maksim Sobolevskiy says:

    Definitely, it SHOULD NOT generate CREATE NEW script. Can you please click on Databsae tools → Forget cached schemas and the press Refresh. Like on the picture: https://blog.jetbrains.com/datagrip/files/2017/04/Untitled-1.png

    If the problem exists please, warn,

    • Richard Haber says:

      Maksim,

      That was the cure! It is now working correctly and I will switch over to using it from 2016.

      Thanks

  13. Alex Aquino says:

    Hello,

    I would like to know if the autocomplete hotkey is working properly because I can’t use it after the last release. What I mean is, the autocomplete is showing just a set of first tables then stop.

    I use Postgres 9.4

    Do I need to update or install anything else?

  14. Tayfun says:

    Hi. I can’t find selected record export ? How can I do this ? It took all records but I want to selected record. By the way, It tooks all columns and I want not null columns in export because it’s unneccessarry. Is there any idea to help me ? Thanks.

  15. Sunny says:

    There currently seems to a bug where the creation of tables, procedures, and functions is displayed with double spaces within the console, like this :
    http://imgur.com/a/oy0OO

  16. Skying says:

    but still can’t backup database how can i backup database include data to .sql file

Leave a Reply

Your email address will not be published. Required fields are marked *