Quantcast
Channel: DataGrip : The Cross-Platform IDE for Databases & SQL | The JetBrains Blog
Viewing all 267 articles
Browse latest View live

DataGrip 2017.1.5

$
0
0

A small update for the current version. The most important fixes:

DBE-2771 —  Important fix with “column reference is ambiguous” for Postgres EDB users.
DBE-4753 — “Invalidate Caches/Restart” is enabled in the Find action menu.
DBE-4733 — Empty rows are removed from the console output tab.

Thanks!

Your DataGrip Team


DataGrip 2017.2 EAP 4

$
0
0

Hi, EAPers! Thank you for trying our early builds.

Transaction Control

In this build, you’re going to meet the Transaction Control feature that replaced the Auto-commit option.

First, define what kind of transaction control you want to use when working with a particular data source. This option is available in data source properties. In the Auto mode you don’t need to commit any transactions executing the commit statement., while in the Manual mode, you, obviously need to do this.

DataSourceProperties

This also can be defined for each query console along with the isolation level.

IsolationLevel

The behavior of the data editor has also changed for the Manual mode. We’ve added two new buttons to the toolbar: Commit and Rollback. The Revert button is moved to the context menu. So, now it works like this:

Auto and Manual mode

Submit button or Ctrl/Cmd+Enter → submits your data, which means that your local changes (they are highlighted) are submitted to the database. If you are in the Manual mode this transaction is not committed.

Revert Selected from the context menu or Ctrl/Cmd+Alt+Z (it used to be Ctrl+Z, but Revert isn’t Undo, right?) on selected rows → reverts unsubmitted local changes of the selected rows.

Only in Manual mode

Commit button or Shift+Ctrl+Alt+Enter → Commits the transaction. If you have unsubmitted local changes (again, they are highlighted) they will be automatically submitted before the commit.

Rollback button → Rollbacks transaction if it’s uncommitted.

Table DDL

We have divided the Data and DDL tabs when viewing a table. Actually, there are no more tabs. Now, when you open a table by a double-click, you just see data. Where is DDL? It can be opened by Edit Source on the toolbar or by Ctrl/Cmd+B.

Edit-source

The same DDL editor will open when pressing Ctrl/Cmd+B on the table name in the SQL script. As you may remember, Ctrl/Cmd+click does the same. In the previous versions this action was bringing you to the database tree. If you still need this, press Alt+F1 on any object and choose Database view.

It became easier to open Data editor for a table. Just click F4 on the table name, either in the database tree or in SQL.

CtrlBF4

Subqueries

And another small enhancement: when you execute a query with subqueries, the outer statement is selected in the drop-down by default. Well, nested statements are often just cannot be executed at all.

Subqueries

Important fixes

Also, we added support for non-int-literal expressions is TABLESAMPLE and ALTER FOREIGN TABLE in Postgres, and for ‘json_table’ function in Oracle.

That’s all for today.
Your DataGrip Team

DataGrip 2017.2 RC is Out!

$
0
0

Hello!

All IntelliJ-based IDEs are getting closer to the 2017.2 release. Here is DataGrip 2017.2 RC. Let’s have a look at what has been added since the latest EAP.

Integration with restore tools for PostgreSQL and MySQL

In 2017.1 we integrated DataGrip with mysqldump and pg_dump, so it’s logical to add integration with the restore tools of these databases as well. Now they can be accessed from the context menu. If there’s only one tool available, this option will look like ‘Restore with pg_dump’, etc.

RestoreMenu

In the case of PostgreSQL, the restore operation can be done with pg_dump or psql: there is a chooser in the Restore dialog:

pg_restore

Psql

And it looks like this in MySQL:

mysqlrestore

Automatic scrolling from a result-set

If you switch result-sets, the corresponding consoles are switched as well.

ScrollFromResult-set

Database objects in bookmarks

Press F11 (F3 for OSX) to add any database object to Bookmarks. Then you can find all your Bookmarks via Shift+F11 (Cmd+F3) and then navigate to the object source by pressing F4.

Bookmarks

Remember that the active DataGrip subscription is required for the RC build.  And don’t miss the blog post about all new features in this release!

DataGrip team.

DataGrip 2017.2 Released!

$
0
0

DataGrip 2017.2 Released!

Hello!

Please give a warm welcome to our new release, DataGrip 2017.2.

DataGrip_20172_splash

We thank all of the EAPers who have helped us by testing all the new features we added in this release. Let’s have a look at them.

– Amazon Redshift and Microsoft Azure support
– Several databases in one PostgreSQL data source
– Transaction Control
– Evaluate expression
– Table DDL
– Integration with restore tools for PostgreSQL and MySQL
– Executing queries
– Coding assistance
– Other

Amazon Redshift and Microsoft Azure support

Database сloud services are growing more popular with every day. We were asked to add support for these two, especially Redshift, and here they are.

NewSupportedDatabases

Microsoft Azure is similar to SQL Server, so we just added a dedicated driver, UI for adding the data source and some enhancements in the introspection.

But there are many things we did for Amazon Redshift.  The introspection is now incremental. This means that only modified objects will be refreshed in a database tree after any operation instead of all objects.

Also, we started to support specific cases in SQL grammar which are different from PostgreSQL. For example, UNLOAD statement is not only highlighted correctly, but has an SQL-injection inside.

Unload

Another example: support for embedded Redshift functions that are absent in PostgreSQL.

RedshiftFunctions

Generation of the DDL scripts for tables and functions has been enhanced.

Now DDL for tables contains the following attribute:

[ BACKUP { YES | NO } ]

column_attributes:

[ IDENTITY ( seed, step ) ]
[ ENCODE encoding ]
[ DISTKEY ]
[ SORTKEY ]

and table_attributes:

[ DISTSTYLE { EVEN | KEY | ALL } ]
[ DISTKEY ( column_name ) ]
[ [COMPOUND | INTERLEAVED ] SORTKEY ( column_name [, ...] ) ]

The source code of a function is now generated with the following section:

{VOLATILE | STABLE | IMMUTABLE }

In general, our support means, that if a part of your Redshift code is highlighted as an error but in fact it isn’t, we consider this a bug. Please report such cases to our issue tracker.

If you’re already using Azure and Redshift via SQL Server and PostgreSQL drivers, please re-select the driver in the data source properties window:

ChangeDriver

Several databases in one PostgreSQL data source

This was a really long-awaited feature, but the wait is finally over. Thanks for bearing with us! We refactored a lot of code to implement this functionality, so some things might still be missing. Please give us your feedback on your experience using data sources with multiple databases.

SeveralDatabasesForPostgres

Data sources with several databases are also supported for Amazon Redshift, Microsoft Azure, and any unsupported databases whose drivers report several databases.

Transaction Control

Transaction Control feature replaced the Auto-commit option.

First, define what kind of transaction control you want to use when working with a particular data source. This option is available in data source properties. In the Auto mode you don’t need to commit any transactions executing the commit statement., while in the Manual mode, you, obviously need to do this.

DataSourceProperties

This also can be defined for each query console along with the isolation level.

IsolationLevel

The data editor in the Manual mode also has Commit and Rollback buttons on toolbar. All actions are also available in the context menu.

CommitInDataEditor

So, now it works like this:

Auto and Manual mode

Submit button or Ctrl/Cmd+Enter → submits your data, which means that your local changes(they are highlighted) are submitted to the database. If you are in the Manual mode this transaction is not committed.

Revert Selected from the context menu or Ctrl/Cmd+Alt+Z (it used to be Ctrl+Z, but Revert isn’t Undo, right?) on selected rows → reverts unsubmitted local changes of the selected rows.

Only in Manual mode

Commit button or Shift+Ctrl+Alt+Enter → commits the transaction. If you have unsubmitted local changes (again, they are highlighted) they will be automatically submitted before the commit.

Rollback button → rolls back transaction if it’s uncommitted.

Evaluate expression

This will help you see data without writing a query to the console.

In other IntelliJ-based IDEs, Ctrl+Alt+F8 on an object gives you quick evaluation. In DataGrip, invoke it on a table in a query to see the data of that table.

QuickEvaluateTable

Ctrl+Alt+F8 on a column name will show the values of that column in the expected result-set.

QuickEvaluatecolumn

If you invoke the same quick evaluate on the keyword of a query (or subquery), the pop-up will show you the result. Note that Alt+Click also works for this.

EvaluateAltGif

Press Alt+F8 to open an Evaluate pop-up, where any query can be run. If invoked on a table, it will show the data.

EvaluateTable

You can evaluate expressions here as well.

Table DDL

We have divided the Data and DDL tabs when viewing a table. Actually, there are no more tabs. Now, when you open a table with a double-click, you just see data. Where is the DDL? It can be opened by Edit Source on the toolbar or by Ctrl/Cmd+B.

Edit-source

The same DDL editor will open when pressing Ctrl/Cmd+B on the table name in the SQL script. As you may remember, Ctrl/Cmd+click does the same. In the previous versions this action  brought you to the database tree. If you still need this, press Alt+F1 on any object and choose Database view.

It became easier to open Data editor for a table. Just click F4 on the table name, either in the database tree or in SQL.

CtrlBF4

Integration with restore tools for PostgreSQL and MySQL

In 2016.3 we integrated DataGrip with mysqldump and pg_dump, so it’s logical to add integration with the restore tools of these databases as well. Now they can be accessed from the context menu. If there’s only one tool available, this option will look like ‘Restore with pg_restore’, etc.

RestoreMenu

In the case of PostgreSQL, the restore operation can be done with pg_dump or psql: there is a chooser in the Restore dialog:

pg_restore

Psql

And it looks like this in MySQL:

mysqlrestore

Executing queries

There is a new action for any file called Attach console. You can find via Ctrl+Shift+A or by opening the context menu for a file. After performing this action, this file can be run against the console. Switching consoles will be useful if you want to run the same script in several data sources.

AttachConsole

Called-for feature: a notification is now displayed when a large query is finished. To disable it, in Settings look for the “Database queries that took much time” notification. It appears if it took more than 20 seconds to execute a statement.

Notification

Many of you have asked for result-sets to be switched along with the corresponding consoles. Done!

SwtichResult-sets_preview

The same works in the opposite direction.

ScrollFromResult-set

These behaviors are on by default, look for the “Autoscroll ..” toggles in the gear-icon menu of the Database Console tool window.

AutoSCrollOff

And another small enhancement: when you execute a query with subqueries, the outer statement is selected in the drop-down by default. Well, nested statements often just cannot be executed at all.

Subqueries

Schema switcher works in MySQL even with a read-only connection.

MySQLSwitcher

Coding assistance

Completion now works for columns in table-valued functions.

TableValued

NEW and OLD references are resolved in PostgreSQL triggers.

NEWOLD

We’ve added support for MERGE statements for all databases where they are available.

Merge

Objects are resolved by their OID values in PostgreSQL.

OIDs

Sequences are resolved in scripts as well.

Sequence-1

Other

New features:

— Database objects can be added to Bookmarks.
— You can now pause file indexing when you need to free the CPU for other tasks, and then resume it when appropriate.
— We added per-monitor DPI support for Windows. Font settings are automatically adjusted based on the display resolution.
— Lines with two identical results are merged in Find in Path.
— Support for non-int-literal expressions in TABLESAMPLE and ALTER FOREIGN TABLE in Postgres.
— Support for ‘json_table’ function in Oracle.

Important fixes:

DBE-4600 with renaming schemas.
DBE-1288 with renaming sequences in PostgreSQL.
DBE-4507 in composite primary key editing.
DBE-4637 about a wrong error message in queries with GROUP BY.
— Faster data editor scrolling

Get your 30-day trial of DataGrip here.

That’s it! Don’t forget about twitterforum, and the issue tracker.

Your DataGrip Team
_
JetBrains
The Drive to Develop

DataGrip 2017.2.1: Improved navigation

$
0
0

Hello! The first update for DataGrip 2017.2 is rather important.

In this release cycle, we are focused on improving navigation. As we wrote in our release blog-post, we divided Data and DDL tabs in the table data editor. There was a problem (well, our fault) that Edit Source wasn’t very visible on the toolbar and it was the only way to see the DDL of the table.

We added several enhancements:

— To see DDL of any database object go to Context menu → DDL and sources → Source editor.

SourceEditorFromCM

— Use Cmd/Ctrl+Alt+B to switch between table’s Data and table’s DDL. It works in both directions. Also, there is the DDL button in the data editor toolbar

DDLInDataEditor

And the Data Editor button in the DDL editor.

DataFRomDDL

— A new action is introduced called Select in the database view. Now there is no UI shortcut, but you can invoke it by Ctrl+Shift+A or define your own shortcut. Remember, that the same can be done in a more general way: press Alt+F1 on any object and choose Database view.

Sidv

We continue working on that. If we still don’t cover your use case, please describe it in the comments.

Other fixes:

— Dump actions now work on files with attached console.
— DBE-4505 No wrong rounding in Oracle during import.
DBE-4902 More… link now works in Quick Evaluate.
— DBE-4953 Scrolling works in the database switcher for PostgreSQL.

DataGrip team
JetBrains

DataGrip 2017.2.2

$
0
0

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.

Meet DataGrip team in USA this September

$
0
0

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.

We open DataGrip 2017.3 EAP

$
0
0

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


DataGrip 2017.3 EAP 2

$
0
0

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

DataGrip 2017.3 EAP 3

$
0
0

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

 

Export data in any way with IntelliJ-based IDEs

$
0
0

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:

COLUMNS <DataColumn> //selected columns
ALL_COLUMNS List<DataColumn> //all columns

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

ROWS Iterable<DataRow> //selected rows

Where:

DataRow { rowNumber(); first(); last(); data(): List<Object>; value(column): Object }
DataColumn { columnNumber(); name() }

OUT {append()} //object to output data
FORMATTER {format(row, col); formatValue(Object, col)} //converts data to String
TRANSPOSED Boolean //checks if data editor is transposed (Gear Icon → Transpose)
TABLE DasTable //object that represents the actual table you’re extracting data from

 

DasTable has two important methods:

Before v2017.3

DasObject getDbParent()
JBIterable<DasObject> getDbChildren(Class, ObjectKind)

Since v2017.3

DasObject getDasParent()
JBIterable<DasObject> getDasChildren(ObjectKind)

 

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

DataGrip 2017.3 EAP 4

DataGrip 2017.3 is Released!

$
0
0

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

DataGrip 2017.3.1

$
0
0

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


DataGrip 2017.3.2

$
0
0

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


DataGrip 2017.3.3

DataGrip 2017.3.4

$
0
0

Here is the first bug-fix update this year. Many issues have been fixed, the most important of which are:

Collations are now placed after schemas in the database tree. If you want to hide them, put collation:-.*  into Data source properties → Options tab → Object filter.

Colations

DBE-5703: А correct DDL statement is now generated when a PostgreSQL function with defaults is dropped.
DBE-5608: Amazon Redshift data source synchronization works now.
DBE-5404: The editor now recognizes the WITH NO SCHEMA BINDING syntax in Redshift.
DBE-2465FETCH ALL IN <cursor name> doesn’t return errors anymore.
DBE-5274: FOR EACH ROW WHEN in triggers shows the correct clause.
DBE-4983: SQL generator doesn’t add the ‘n’ character in new lines in Oracle anymore.

Fixed freezes:
DBE-2536: While introspecting schemas with many tables.
DBE-5532: After updating a function.

DataGrip team

Generate simple classes from database objects in DataGrip

$
0
0

twitter_post_feb_2018_blog

DataGrip lets you run scripts against the selected schema objects. For example, you can generate Java classes from tables or, if you want, classes in any other language: C#, Python, etc. You can alter or extend the default functionality, for instance, generate an HTML or Markdown report.

Out of the box, DataGrip can generate Java classes. To do this, go to the context menu of a table (or several tables) and press Scripted Extension → Generate POJO.groovy.

ContextMenu

Choose a destination folder, and that’s it! The class-file is ready.

ScriptItself

Generate POJO.groovy is just a script written in Groovy. It means that you can modify it and create a new script based on it, for example, for generating classes for other languages. From the same context menu, click on Go to scripts directory to see where this file is placed.

ActorJava

You can edit the existing one or create new scripts. Just place your new script into this folder, and it’ll be available from the context menu.

Some examples from our users:
Improvement of default script: comment support and replacing underscores in names.
POJO Generators for Entity
Generator of classes for Kotlin Squash
Export structure as markdown into the clipboard

Groovy is not the only language you can use, JavaScript is also available.

Before we also had Clojure engine and some people used it for scripting. For instance, here is the script for generating C# classes. If you strongly wish to use Clojure for scripting, please download Clojure runtime and scripting engine files here and place them in the lib folder inside the installed DataGrip folder.

We hope this post helps, feel free to ask questions if any.

DataGrip 2017.3.5

$
0
0

Hello! Here is the new bug-fix update for 2017.3.

There is even a new feature in the release: object filter. Define which objects you want to see in the database tree.

Filter

The most important bug-fixes are:

— Code completion respects number input: DBE-4965
— Paste from CSV format is now correctly detected
— New types of fields are available for editing in PostgreSQL: point, polygon, line, lseg, box, path, circle, pg_lsn, tsquery, tsvector

We open EAP for DataGrip 2018.1

$
0
0

Yes, it has finally happened! :) We hope that in the next month you’ll use our early builds and share your feedback with us. As usual, our issue tracker, twitter and forum are open for you.

Let’s have a look at the goodies inside this EAP.

Data editor SQL log

Now, while updating data you can see which particular queries DataGrip is running. We have nothing to hide!

SQLLog

Connectivity and introspection

Now you can tell DataGrip how to switch schemas. The following settings are available:

Automatic: DataGrip can switch schemas during internal operations when defining the context. This is the default behavior for all databases except PostgreSQL.
Manual: DataGrip cannot switch schemas during internal operations when defining the context. However, you can switch them manually via the switcher in the top-right corner. This is the default behavior for PostgreSQL: if you work with pg_bouncer, no more wildcat switches!
Disabled: Note that manual switching is also disabled in this mode.

SwitchSchema

We’ve added MariaDB to our list of supported databases.

MariaDB

DataGrip now supports external schemas in Redshift and virtual schemas in Exasol.

ExtrenalObjects

Events in MySQL are shown in the database tree. Source code generation is also available. Icons will be delivered soon :)

Events

SQL editor

Now DataGrip lets you navigate to the next or previous identifier occurrence by using two shortcuts, Alt + Wheel down and Alt + Wheel up. (Or enter ‘highlighted element usage’ in Find Action.) Before, you could only navigate to the next text occurrence. It should be noted that text occurrence and reference are not always the same.

GoToUsage

Another new action in DataGrip is Move element left or right. This works for different kind of lists including parameters inside functions, fields in INSERT statement, and the column list. Note that it doesn’t spoil the comma while working with the column list, while Move Line surely would.

MoveElements

Completion for file references now works for Oracle and Exasol.

FileCompletion

SQLite commands used to spoil highlighting. No more.

SQLiteCommands

Common table expressions are supported in MySQL.

CTE

Navigation
We’ve merged two navigation actions: Go to class and Go to table.

EnterCalssName
In DataGrip, you can now navigate to classes if you use any of the other supported languages.
In other JetBrains IDEs, you can finally see database objects here like tables, stored procedures, etc.

IntelliJ Platform enhancements
— In the Replace in Path window, the IDE now provides an ability to preview a regex replacement.
— Now, the Search Everywhere pop-up receives focus (IDEA-124160).
— When you search through the current file, the IDE now highlights folded code regions if they contain the matching occurrences.

That’s about it! Thank you in advance for taking these EAP builds for a spin. Do let us know what you think!
Your DataGrip Team

Viewing all 267 articles
Browse latest View live