DataGrip 2017.3.2

Hello! This is another minor update for 2017.3. It brings several important bug-fixes:

DBE-5031 – Enum fields are now available for editing. Completion is not yet implemented.
DBE-5512 – Fixed bug with saving LOBs.
DBE-4426 – DataGrip now can connect to FrontBase. There are still some known issues with transactions.

DataGrip team

Posted in Uncategorized | Leave a comment

DataGrip 2017.3.1

Only a week has passed since we released DataGrip 2017.3, and we are already delivering you the first minor update. Among various bug-fixes there is something new to try!

IDE-level read-only mode

For ages DataGrip had a Read-Only mode that could be turned on in the data source properties.

image2

It just turned on read-only mode in the corresponding jdbc-driver. This denied running modification queries in MySQL, PostgreSQL, AWS Redshift, H2 and Derby. In other DBMS’s it did nothing.
In DataGrip 2017.3.1 we have added an IDE-level read-only mode. Now it is activated along with the jdbc-level one, the check-box turns on both. Thus, in read-only mode every DDL or DML query will be underlined.

image7

If you execute it, there will be a warning.

image5

Anyway, it is possible to press Execute on this bar if you’re totally confident in what you are doing.

We also now index the source codes of functions and procedures, and build a call-tree behind. It means that if a function executes another function (repeat n times) which executes DDL or DML statements, you’ll also see the warning.

image4
That’s it. Please, report to us if you have any need for two independent check-boxes for jdbc-level and IDE-level read-only modes.

Background images

If you set a background image via Preferences/Settings → Appearance → Background images, now there are new alignment options: center image, stretch image or make a texture. The very right square lets you to choose the anchor.

image6

Snap packages

DataGrip is now also available as a snap package. If you’re on Ubuntu 16.04 or later, you can install DataGrip from the command line:

sudo snap install datagrip --classic

Thank you for reading this, we hope you got a lot out of it!
Your DataGrip Team
_
JetBrains
The Drive to Develop


Posted in Uncategorized | Leave a comment

DataGrip 2017.3 is Released!

Please welcome DataGrip 2017.3, the third big update of 2017, packed with various enhancements. Let’s have a look what it has to offer!

Database tree view
SQL
Executing queries
Connectivity
Data editor
Navigation

Database tree view

Group data sources

Closing an old outstanding ticket with a number less than 100 is not a situation that we frequently find ourselves in; especially when it’s for such a long-awaited feature. We are happy to introduce you to our new feature: group data sources. Press F6 or choose Move to group… from the context menu.
01 — Groups

Group is the attribute of the data source. Now you cannot create an empty group and add existing data sources to it. Please, usе New group as shown on the screenshot.

Managing schemas

We replaced the Schemas… node in the database tree view with a lightweight hover option, which when used, will show the number of schemas currently displayed. Click on it to add or hide schemas.

02 — Hovers

It is also possible to use Context menu → Database tools → Manage selected schemas or you can simply press Alt+Enter on the data source.

New supported objects

Users and roles are now displayed in PostgreSQL and AWS Redshift.
04 — UsersRoles

Foreign Data Wrappers and as a consequence, foreign tables, are now displayed in PostgreSQL.
05 — ForeignData

Drag-and-drop multiple objects to the editor

Now you can drag-and-drop several objects from the database tree view to an editor.

06 — DragnDropColumns

Well, if you need all of them, then use the Expand wildcard with Alt+Enter, as it is definitely more suitable :)

SQL

It is now possible to use the SQL generator to generate DDL scripts with options. To do this, press Ctrl/Cmd+Alt+G or choose Context menu → SQL Scripts → SQL Generator… and get the generated DDL of any kind of object (table, schema, procedure, whatever) or even several objects simultaneously.

01 — SQL-Generator

The JOIN statement completion has become even smarter! It now offers you the variant with the complete clause.

02 — JoinCompletion

We have added PostgreSQL 10 grammar support.

03 — Postgres10

If you are already using PostgreSQL 10 and you see any incorrect code highlighting, please report it to us.

Executing queries

DataGrip will now prompt you to choose a database/schema along with a data source when you try to run an SQL file from the context menu.

01 — SchemasInRun

Another similar enhancement we have made is that a list of data sources with related consoles will now appear when attaching the console to a file.

02 — AttachConsole

There was only one Execute action before; now there are three of them. Change the behavior, and assign shortcuts: they are all completely independent. For example, you can create an action which will execute the whole script, without having to choose the exact query from the script.

03 — ExecuteActions

There is a small improvement — made especially for those of you who don’t like to use a mouse — to be able to choose the schema of the console or the search path schema. Now there is an action called Set Current Schema. You can invoke it from Find Action (Cmd/Ctrl+Shift+A).

04 — SetCurSChema

Or just assign a shortcut! For example, Cmd/Ctrl+Up will enable you to switch the context for the query console.

05 — ChooseSchema

That shortcut is assigned to Show navigation bar by default in the platform, do you really use the Navigation bar? If yes, try Recent Files with Ctrl/Cmd+E.

Connectivity

Enhancements in SSH tunneling: this build of DataGrip supports:

— Reading OpenSSH config files (~/.ssh/config and /etc/ssh/ssh_config).
— Showing dialogue for a One Time Password.
— Using an SSH-agent and Pageant for authentication.

01 — SSH

Also, we added support for the Exasol database.

02 — Exasol

Data Editor

We were asked to implement pasting from Excel tables. Generally to do this, it means that we need the ability to paste data in a DSV format. In DataGrip you can define any format you want, or you can let the IDE detect the format automatically.

02 — PasteDetect

That’s how it works.

01 — PasteTSV

For better readability, the data editor now aligns the numerical data with the right-hand side of the column.

03 — Align

Before, DataGrip didn’t restore tabs after re-opening. It was inconsistent with our other IntelliJ-based IDEs and it was not so easy for people to adjust to. Performing many queries at the start is not the best idea, so now the tabs are restored, and you can load the data to the data editors manually.

04 — RestoreTabs

And the last enhancement in this section: values of two or three cells can be compared in the Diff Viewer. Select them and press Shift+Ctrl/Cmd+D

05 — CellDiff

In one of the minor updates to 2017.2, we introduced a new flow for navigation. To cover all of the possible use-cases, and for those who are used to the previous versions; in 2017.3, we have added the option Navigate references to DDL editor.

01 — NavigateToDDL

With the Auto-scroll from Editor option, you can set up several types of behavior by pressing Navigate to declaration (Ctrl/Cmd+B or Ctrl/Cmd + Click)

01a — AutoScrollFromEditor

Navigate references to DDL editor On
Auto-scroll from Editor On
You’ll be taken to the DDL of the objects; the objects will be highlighted in the Database View. Focus in the Editor.

Navigate references to DDL editor On
Auto-scroll from Editor Off
You’ll be taken to the DDL of the object; nothing will be highlighted in the Database View. Focus in the Editor.

Navigate references to DDL editor Off
This will enable the “Old” behavior. The object will be highlighted in Database View; the Editor tab will remain as it is. Focus in the Database View.

The context menu in the data source has also been upgraded. Choose Jump to Console and you’ll now have a menu which you will be able to use to quickly switch between consoles which have already been created.

02 — JumpToConsole

DataGrip 2017.3 has the ability to replace the selected occurrences in the Replace In Path dialog.

04 — FindInPath

Scratches and Consoles are not found in a separate tab anymore; they are now placed in Files.

05 — Scratches

Other

Synchronize your settings across devices.
— Time is always displayed in UTC.
— Generating DDL on the tables node doesn’t include views anymore.
— DDL generation in MySQL works with escaped quotation marks. But the fix can improve performance problems. See details.
— All the attributes (except obj_file and ink_symbol) are generated in the function DDL for PostgreSQL.
Better PIVOT support.
— Expand column list deals well with table aliases.
— SQL extractors respect casing setting of the Code style
Ability to choose the current schema for custom database’s query console.

You already know all of this, but still:

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

Thank you for your attention!
Your DataGrip Team
_

JetBrains
The Drive to Develop

Posted in 2017.3, Features, Releases | 11 Comments

DataGrip 2017.3 EAP 4

This EAP build doesn’t bring you any important new features, but it does include some major bug-fixes:

— IDE doesn’t freeze while building database diagram
— Fixes in SSH support: DBE-5434, DBE-5409, IDEA-181525

DataGrip team

Posted in Uncategorized | Leave a comment

Export data in any way with IntelliJ-based IDEs

In DataGrip, or any other JetBrains IDE featuring database support, there is a powerful engine to export data in many formats. You can even create your own export format.

ExportSq1

Let’s look closer at this engine.

Export directions

Any table/view or result-set can be exported to a file or copied to the clipboard.

To export to file:
      — Context menu on a table/view and → Dump data to file.
      — Context menu on a query and → Execute to file.
      — In the toolbar of the result-set or data editor, select Dump data button → To File…

DumpToFile

To export to clipboard:

      — Select the data you need within a result-set or data editor and press Copy or Ctrl/Cmd+C.
      — In the toolbar of a result-set or data editor, select Dump data button → To Clipboard

Default extractors

We’ll talk about copying data to the clipboard from the data editor, but the same applies to other described ways to export data.

Look to the left of the Dump data button for a drop-down where you can choose the extractor — the format to export data in.

ChooseSQLInserts

There are several built-in formats as you can see. Some of them let you export data as a set of INSERT/UPDATE statements, while others export data as text such as CSV, JSON, HTML, etc. For more details on how they work, please visit this page.

Still, users may need to extract data in many different ways.

Twitter

Creating a DSV-based extractor

Let’s see how we can extend the default functionality.

To create your own format based on CSV (or any DSV format), select Configure CSV formats…

ConfigureDSV

In this dialog, in addition to changing the existing CSV and TSV extractors, you can create your own. For example, Confluence Wiki Markup.

ConfluenceWikiMarkup

Once created, it appears among the other extractors.

ConfluenceWikiMarkuipInMenu

Creating any text extractor with scripting

For the more complicated cases, consider using scripting extractors. Several of them are already there such as CSV-Groovy.csv.groovy, HTML-Groove.html.groovy, and others. These scripts are written in Groovy, but they can also be written in JavaScript. Our examples use Groovy.

Looking closely at the file name, CSV-Groovy.csv.groovy:

      CSV-Groovy is just the name of the script;
      csv is the extension of the result file if you extract to file;
      groovy is the extension of the script itself. It helps IntelliJ IDEA highlight your code if that’s where you create/edit your scripts.

Scripts are usually located in Scratches and Consoles/Extensions/Database Tools and SQL/data/extractors. Or you can select Go to scripts directory in the extractor menu to navigate there.

ChooseGoToSCriptsDirewctory

You should edit an existing extractor or just add your own to this folder.

Let’s create an extractor which will dump your data to CSV format, but to just one row. It can be useful if you are going to paste these values into an IN operator in a WHERE clause.

Here is the diff view of two scripts: the existing CSV-Groovy.csv.groovy and our new one which we’ll name CSV-ToOneRow-Groovy.csv.groovy.

ScriptsDif

Note the available context bindings:

These objects are equal when dumping the whole page to file.

Where:

 

DasTable has two important methods:

Before v2017.3

Since v2017.3

 

Additional information about the API can be found here.

When you create or edit Groovy scripts in IntelliJ IDEA, and have Groovy installed, coding assistance is available.

CodingAssistance

Once the new script file is in the folder, you can use the extractor!

ChooseCSVGToOneRow

Copy these values and paste them into the query.

ToOneRowSQL

Here’s another example based on SQL-Insert-Statements.sql.groovy. MySQL and PostgreSQL allow using multi-row syntax. To use this type of extractor, create a new SQL-Inserts-MultirowSynthax.sql.groovy file in the scripting folder.

SQLInsertsMultiRowExtractor

Again, simply select it in the menu.

ChooseSQLMultiRow
The result:

InserMultiRowSQL

There are already some user-generated extractors on GitHub which everybody can use:

Extractor to copy tab separated query results to paste into Excel with comma decimal separator.
DBunit XML.
Txt-file with fixed length columns. (Here’s a very similar one).
Php array.
Markdown.

We hope this tutorial will help you tweak DataGrip to your specific needs and encourage you to share extractors for all to use.

The DataGrip Team

Posted in Features, Tutorial, Uncategorized | 3 Comments

DataGrip 2017.3 EAP 3

Hi there! In this post, I’ll tell you all about what our team has been up to and what the latest EAP build has in store for DataGrip 2017.3.

SQL generator

Press Ctrl/Cmd+Alt+G or choose Context menu → SQL Scripts → SQL Generator… and get the generated DDL of any object (table, schema, procedure, whatever) or even several objects simultaneously.

SQL-Generator

Paste multiple rows from an external source

We were asked to implement pasting from Excel tables. Generally to do this, it means that we need the ability to paste data in DSV format. In DataGrip you can define any format or you can let the IDE detect the format automatically.

PasteDetect

That’s how it works now.

PasteTSV

SSH tunneling

SSH

From this build DataGrip supports:

— Reading OpenSSH config files (~/.ssh/config и /etc/ssh/ssh_config).
— Showing dialogue for One Time Password.
— Using Ssh-agent and Pageant in authentification.

P.S. And for those who use DataGrip with Exasol, we added Exasol 5 support!

That’s all for today. Take DataGrip 2017.3 EAP for a spin!

Your DataGrip Team

 

Posted in 2017.3, EAP, Uncategorized | 9 Comments

DataGrip 2017.3 EAP 2

Hi there! Meet the new DataGrip 2107.3 EAP build.

Database view

Closing a ticket with a number less than 100 is not something that frequently happens. Especially when it’s a long-awaited feature. We are happy to introduce our new feature: group data sources. Press F6 or choose Move to group… from the context menu.
Groups

Users and roles are now displayed in PostgreSQL and AWS Redshift.
UsersRoles

Foreign Data Wrappers and as a consequence, foreign tables, are now displayed in PostgreSQL.
ForeignData

 

References navigation

In one of the minor updates to 2017.2 we introduced a new flow for navigation. To cover all the use-cases, and for those who are used to the previous versions, in 2017.3 we added the option Navigate references to DDL editor.

NavigateToDDL

With the Auto-scroll from Editor option you can get several types of behavior by pressing Navigate to declaration (Ctrl/Cmd+B or Ctrl/Cmd + Click)

AutoScrollToEditor

Navigate references to DDL editor On
Auto-scroll from Editor On
You’ll be taken to the DDL of the objects, the objects will be highlighted in the Database View. Focus in the Editor.

Navigate references to DDL editor On
Auto-scroll from Editor Off
You’ll be taken to the DDL of the object, nothing will be highlighted in the Database View. Focus in the Editor.

Navigate references to DDL editor Off
“Old” behavior. The object will be highlighted in Database View, the Editor tab will remain as it is. Focus in the Database View.

 

Compare cells

Values of two or three cells can be compared in Diff Viewer. Select them and press Shift+Ctrl/Cmd+D

CellDiff

PostgreSQL 10 grammar support

Postgres10

If you are already using PostgreSQL 10 and see any incorrect code highlighting, please report it to us.

Other enhancements

Adding support for automatic Regexp detection in regexp_replace function, we added automatic detection of Regexp, JSON, XML and XPath to many functions and operators in various databases. To use XPath injection, please, install XPath view + XSLT Support plugin. View all of the new injections in Settings → Editor → Language injections.

Synchronization of your settings across devices.

Better PIVOT support.

— Expand column list deals well with table aliases.

That’s it! Your feedback is welcome on our twitter, forum and the issue tracker.

Your DataGrip Team

Posted in 2017.3, EAP, Uncategorized | Leave a comment

We open DataGrip 2017.3 EAP

Hello! There is a long tradition of letting you try out our new product features before the official release, so welcome DataGrip 2107.3 Early Access Program.

EAP_DataGrip_20173EAP@2x_splash

This version improves the workflow with consoles and files, adds new Execute actions and introduces right alignment of numbers. Let’s take a closer look at the new features:

Ability to choose a console

The context menu in the data source was upgraded. Choose Jump to Console and you’ll now have a menu which allows you to quickly switch between consoles which were created already.

EAP_JumpToConsole

The same options will appear when attaching the console to a file.

EAP_AttachConsole

Several Execute actions

There was only one Execute action before; now there are three of them. Change the behavior, and assign shortcuts: they are completely independent. For example, you can create an action which will execute the whole script, without having to choose the exact query from the script.

EAP_ExecuteActions

JOIN statement completion

It became even smarter! Now it offers you the variant with the complete clause.

EAP_JoinCompletion

Right-side alignment of numerical data

For better readability, now DataGrip aligns the numerical data in the table editor with the right hand side of the column.

EAP_Align

Choosing schemas

We moved Schemas… node from the database tree, now use Context menu → Database tools → Manage selected schemas or simply press Alt+Enter on the data source.

EAP_schemas

DataGrip now prompts you to choose a database/schema along with a data source when you try to run an SQL file from the context menu.

EAP_SchemasInRun

And there is a small improvement for those who didn’t like to use the mouse to choose the schema of the console or the search path.

EAP_ShortcutForChooser

Now there is an action called Set Current Schema. You can assign a shortcut or invoke it from Find Action (Cmd/Ctrl+Shift+A).

EAP_SetCurSChema

Support for Exasol

We added the support for Exasol database, thanks to authors for their help! And we’ll be happy to hear the feedback from those, who use Exasol.

EAP_Exasol

Other enhancements
– Time is always displayed in UTC.
– Generate DDL on tables node doesn’t include views anymore.
– DDL generation for tables is better.
– DDL generation in MySQL works with escaped quotation marks. But the fix can raise performance problems. See details.
– All attributes (except obj_file and ink_symbol) are generated in the function DDL for PostgreSQL.

That’s it! Your feedback is welcome in our twitter, forum and the issue tracker.

Your DataGrip Team

Posted in 2017.3, EAP, Uncategorized | 4 Comments

Meet DataGrip team in USA this September

dg_meet_us_800x418_twitter_card_5

Hello! This September a couple of folks from DataGrip team will take part in several events in the United States. Maksim Sobolevskiy (Product Marketing Manager) and Vasiliy Chernov (QA Engineer) will give a DataGrip tips’n’tricks talk at various meetups and will be running a booth at SQL Saturday conference in Spartanburg.

Sep 13th, 17:30, New York. SQL Training wheels user group.
https://www.meetup.com/SQL-Training-Wheels/events/242799854/

Sep, 19th, 18:00, Austin.  Meetup hosted by TableauHelp and data.world.
http://tableauhelp.com/event/event09192017-datagrip/

Sep. 22nd, 12:00, Atlanta. PHP user group Special JetBrains Event.
https://www.meetup.com/atlantaphp/events/243171976/

Sep 23rd, Spartanburg. SQL Saturday. Meet us at the booth all through the day!
http://www.sqlsaturday.com/681/eventhome.aspx

Sep, 25th, 18:00, Chicago. PostgreSQL Meetup.
https://www.meetup.com/Chicago-PostgreSQL-User-Group/events/242887113/

We kindly ask you to register for the events — it will help both the organizers and us. At every event you’ll have a chance to grab some swag and 20% discount coupons for DataGrip!

See you in the States!

DataGrip team.

Posted in Uncategorized | Leave a comment

DataGrip 2017.2.2

This is a new minor update for DataGrip 2017.2.

There are many important fixes in this build:

— Export options are enabled again, but some issues persist, so we don’t close this issue.
— Custom dialect data sources are visible in the Run against list.
— Many people complained about UI freezing, we investigated this and fixed bugs raising the problem.
— Editing data in DB2 is back.
— Stored procedures code is generated correctly in SQL Server.

See all fixes in 2017.2.2.

DataGrip team.

Posted in Uncategorized | 4 Comments