DataGrip 2019.2 EAP

Hello! No long preamble, we have begun our DataGrip 2019.2 EAP! Let’s look at what’s inside.

tKxcasig

Services tool window

All our IDEs now have a new tool window called Services. In DataGrip, you can observe and manage all the connections there. Here is how it looks:

Services

Every connection has its own node under the corresponding data source. If the small green light on the icon is on, it means that the connection is alive. You can close any of them.

You can view all the service types as nodes, or you can alter the view to see them as tabs. Use the Show in New Tab action from the toolbar or simply drag and drop the needed node on to the edge of the Services tool window.

The query result is now attached to the particular console under its connection in the
Service view. We realize that the UI has changed a bit, so please provide us with feedback. During the EAP there is still the chance to test and apply changes quickly. For now, if you want to have more room for the results, change the size of the left panel.

Query live timer

The Services tool window also provides you with some very requested functionality: a query live timer. As you can see, to the right of every connection which runs a query there is information about the time it has taken.

Now there is the ability to search for some data even if you don’t know where it is located. To do this, select the data sources or groups of data sources you want to search through and invoke Full-text search from the context menu. There is a shortcut as well: Ctrl/Cmd+Alt+Shift+F.

FTSInvoke

Then you will see the dialog you should put the string you need into. Here you can see the list of data sources to search through and also define some options for the search.

FTSDialog

As soon as you have started the search, DataGrip performs queries against all the tables and views in these data sources. These queries just search for the string using the LIKE operator.

After you see the results you can open them.

FTSResults

After clicking on the result, the data editor will open. The filter will be pre-defined to give you only those strings where the data is found. If you cannot locate the data because of the number of columns, use text search in the data editor: Ctrl/Cmd+F.

FTSResultsData

Filtering by a data source in search and navigation

When you are locating an object in the GoTo pop-up, sometimes many similar objects are present in the list. It frequently happens when you have many mirrors: production, staging, test, etc.

In DataGrip 2019.2, you can choose where to search: in a particular data source or in a group of them.

ScopesNavigation

The same works for Find In Path which is extremely useful when searching for source code inside of DDLs of other objects.

ScopesFindInPath

Code analysis

First, we integrated a quick-fix into the inspection tooltip. Now, if DataGrip knows how to fix the problem, you will know about it by just hovering the mouse over the warning. To fix the problem just click on the link at the bottom left corner of the tooltip or press Alt+Shift+Enter.

ActionsPopup

Alt+Enter still works for getting the list of all the possible quick-fixes.

Also, we’ve introduced several new inspections.

Unnecessary usage of CASE

When you use CASE construction DataGrip analyzes whether they can be transformed into more readable ones.

To IF:

InspCaseToIf

Or to COALESCE:

InspCaseToCoal

Possible truncation of the string

DataGrip detects the length of the string when assigning a value to the variable and warns you if it will be truncated.

InspStringWillBeTrunc

Database tree view

Quick backup of the table

It was possible to copy tables via drag-n-drop, but it didn’t work when copying to the same schema. In fact, this could have been very handy if you ever needed to create a quick backup of the table before any crucial data manipulations. So we’ve now made it work!

QuickBackup

Live connections

From 2019.2 the small green light indicates if there is an alive connection to the data source.

DataBaseTree

Table comments

If you wish to see comments of the tables in the tree view toggle View | Appearance | Descriptions in Tree Views option.

CommentsInTree

Miscellaneous

New option to control the behavior of Move Caret to Next Word

The default behavior of the Move Caret to Next Word action is changed: the IDE will move the caret to the end of the current word.

To change the behavior of the caret movement actions, go to Preferences/Settings | Editor | General.

CaretOptions

People usually perform this action by pressing Ctr+Arrows on Windows and Linux and
Opt+Arrows on Mac. It has different default behavior in different operating systems. In Datagrip we used Windows-like behavior and we changed it to the Mac-like one.

This how it was before:

MoveCaretBefore

And now it’s like this:

MoveCaretAfter

Anyway, if you like the previous behavior, you can always customize it.

Editable columns in Cassandra

In Cassandra now you can edit these types of columns: set, list, map, tuple, udt, inet, uuid, and timeuuid.

CassandraEdits

Other

— The upcoming DataGrip 2019.2 will run under JetBrains Runtime 11, the uncertified fork of OpenJDK 11, by default.
Jump outside closing bracket/quote with Tab option is enabled by default.
Surround a selection with a quote or brace option is enabled by default.
Introduce alias action is added to the refactoring menu.
— DataGrip works with PostgreSQL 12: DBE-8384.

DataGrip team

Posted in EAP, Features | Tagged | 4 Comments

DataGrip 2019.1.3

Hi! This is the third update for DataGrip 2019.1.

First, there are no more freezes after sleep! https://youtrack.jetbrains.com/issue/IDEA-210361

Also, we’ve fixed the annoying indentation in SQL Server that was happening after starting a new line.

Other fixes:

IDEA-176926 The All Places scope now includes scratch files and consoles. This is more important for anyone using the database plugin in other IDEs, and not DataGrip itself. In DataGrip scratches and consoles were already part of the All Places scope.
DBE-7993 The Formatter keeps the line break before INTO.
DBE-8223 The Formatter doesn’t break the code by quoting local variables.
DBE-8248 The Sublime keymap is bundled.
DBE-8133 Export into INSERT statements works again for Cassandra.

Posted in Uncategorized | Leave a comment

DataGrip 2019.1.2

Hi! This is the second update for DataGrip 2019.1.

Formatter

First and foremost, now the code style can be configured separately for different dialects.

CodeSTy

Please note, you can paste examples of your code to the preview panel on the right-hand side to check that the style you have configured formats the SQL correctly. More dialects come later.

Code insight

DBE-1837: Columns from outer queries are now highlighted.

Screenshot 2019-04-30 13.14.04

DBE-3778: Better support for aggregate functions. DataGrip will warn if you use them in the wrong place.

Screenshot 2019-04-30 13.47.50

DBE-5368: Unnecessary keywords for ORDER BY are highlighted

Screenshot 2019-04-30 13.49.49

Using the HAVING clause with no aggregates will also generate a warning

Screenshot 2019-04-30 14.05.28

Snowflake

We’re continuing to improve the Snowflake native introspection. Warehouses and stored procedures are now supported!

Important fixes

DBE-8217 [Cassandra] Support for lightweight transactions
DBE-8037 [MySQL] Support for JSON_TABLE()
DBE-8180 No more freezes when pasting big chunks of text

Posted in Uncategorized | Leave a comment

DataGrip 2019.1.1

Hi! This is the first update for DataGrip 2019.1. We’ve made some improvements regarding positional column references.

Column references are resolved in GROUP BY (before the resolve worked only in ORDER BY).

Screenshot 2019-04-25 16.32.11

If the column reference is unresolved, DataGrip will highlight it.

Screenshot 2019-04-24 16.44.28

By the way, unresolved references are now highlighted in red. This is consistent with all our IDEs. Red helps draw your attention to something that’s not normal, and generally, unresolved references are not normal! Have everything resolved makes navigation and code insight features work as they should.

We’ve also introduced a couple of intention actions:

  • Replace column number with a name
  • Replace column name with an ordinal number

IntentionRefs

It is also possible to set the timezone for the session.

Untitled-2

And a few other important fixes:

DBE-3024 The first version of the native introspection for Snowflake was introduced
DBE-2056 [SQLite]: ROWID is shown in the column list
DBE-3315 COUNT(*) works for queries with JOINs and GROUP BY
DBE-4533 Access to the last page of the query is not slow anymore

That does it. Cheers!

The DataGrip Team

Posted in Uncategorized | Leave a comment

DataGrip 2019.1

Hello everybody!

We are excited to release DataGrip 2019.1 today! As usual, we thank all our early adopters who have helped us make the IDE better during this release cycle.

image

If you wish to see the detailed overview of this update, please visit our What’s new page. Read on for a list of all the enhancements waiting for you in 2019.1.

Support for new databases

In this release cycle, we focused a lot on supporting several new databases.

Greenplum is an analytics database based on PostgreSQL. It is currently developed by Pivotal and the open source community.

Vertica is column-oriented storage designed to handle large volumes of data.

Apache Hive is a data warehouse built on top of Apache Hadoop for providing data query and analysis.

Snowflake is a cloud-based data-warehouse. In 2019.1 DataGrip supports only SQL dialect, the introspection support comes later.

ThreeGraces

Connectivity

— The connection dialog has a new look.
— Startup scripts.
— Keep-alive and auto-disconnect options.
— Now you can choose not to remember your password at all. (In previous versions, unselecting Remember password meant that it was remembered only until the next DatGrip restart.)
— Possibility to save password until you disconnect from the data source.
— Possibility to set an empty password.
— Separate section for DDL data sources in the connection dialog.
— DataGrip offers to download drivers after you click Test Connection.
Test Connections results are now inline.

Options

Navigation and search

— New Recent Locations popup.
— Better usability for Find in Path.
— All navigation actions work from the Go-to popup.

Recent

Code insight

— Code completion supports combined statements for CREATE and DROP, i.e. CREATE TABLE.
— New inspections: Illegal cursor state, Named arguments should be used, and Usages of GOTO statements.
— [MariaDB] Oracle mode support.

CompletionCreate

Working with files

— The Default Directory setting works.
Save console as… uses the default directory and respects the last choice.
Detach directory in the Files tool window.
— Files can be formatted from the context menu without opening them.

Detach

Database tree view

— [DB2] New objects are displayed in the database tree view: trigger, method, module, data type, variable, sequence, role, and others.
— The database tree view keeps the data source name at the top as you scroll.
— Logo icons are added for Firebird, Presto, Teradata, Snowflake, and Informix.
— Library of cutom icons.

DB2

Other

— Customizable IDE themes.
— The filter in the data editor suggests the current clipboard value.
— [MySQL] We’ve finally fixed the problem with NULL instead of the empty date for all connectors.
— [MySQL; MariaDB] Support for DEFINER attributes.
— [SQL Server] No more wrong COUNT() results.

ThemePurple

And more…

You already know all of this, but still:
— Get your 30-day trial of DataGrip.
— Tweet @ us!
— Discuss anything in the forum.
— Report bugs to our issue tracker.

Thanks for reading this!

Your DataGrip Team
_
JetBrains
The Drive to Develop

Posted in Features, Releases | Tagged | Leave a comment

DataGrip 2019.1 EAP 3

Let’s have a look at what’s new and improved in DataGrip 2019.1 EAP 3.

Connectivity

A new option in Save password: For Session. It will save your password until you disconnect from the data source.

PassSave

Test connection results are now inline and can be copied to the clipboard via a small dedicated button. The link to the troubleshooting page is also added.

TestConnectionRes

Find in path

DataGrip can search in source codes of the objects. This was available only if you chose the All Places scope. We’ve cleaned up this UI a little bit and removed the Module and Project tabs.

A new scope, Attached Directories, is available. Use it if you want to search through files in the Files tool window.

FindInPath

Go-to popup

All navigation actions now work from here.

FindTable_blog

For instance, if you’re searching for a table, see what you can open from right here:

Table’s DDL: Ctrl/Cmd+B.
Table’s data: F4 (Enter does the same for tables).
Modify Table dialog: Ctrl/Cmd+F6.
Locate in… popup: Alt+F1 (Use it to see the object in the database tree view).
Quick doc popup: Ctrl+Q/F1.
SQL generator: Alt+Ctrl/Cmd+G.

There are many more actions related to the objects you see here!

Also, don’t forget about Navigation settings in Database | General. Feel free to create your own flow, as DataGrip now really does cover all possible use cases.

NavigationOptions

Code insight

We added the support for Snowflake SQL.

Screenshot 2019-03-28 14.46.47

The support for database objects comes later. Now JDBC-based introspection works.

New inspections

DataGrip will warn you if the cursor you use is not opened when inside a procedure or function.

InspectionCursor_blog

The next two new inspections are turned off by default as only some developers want these things to be reported.

InspectionsList

Named arguments should be used

NamedParams

Usages of GOTO statements

This inspection has three options:
-Report all GOTO statements;
-Report uses of GOTO statements to exit a loop;
-Report backward GOTO statements;

GotoInspection

Customizable themes

This release adds the possibility to fully customize the appearance of the IDE as now you’ll have the power to design your own theme from scratch. We’ve created a few brand new themes to get you started. They can be downloaded as plugins:

ThemesAsPlugins

Here’s what they look like:

Dark Purple theme

ThemePurple

Cyan Light theme

ThemeCyan

We’ve made significant changes in our codebase so that you can tweak the entire IDE appearance, including icon colors, radio buttons, arrows, the color scheme, and everything else you can think of. You can literally change the color of anything.

You can create your own theme plugin using the DevKit and modify the IDE appearance via a JSON file. Here are some links that you may find useful:

That’s it!

Your feedback is extremely welcome in our twitter or forum! By the way, this version introduces a handy feedback method: just click Help -> Report problem… to raise a new issue in our issue tracker!

DataGrip team

Posted in Uncategorized | Leave a comment

DataGrip 2019.1 EAP 2

We have a new build for the 2019.1 EAP available. The major release of DataGrip 2019.1 is planned for early April.

Connectivity

We’ve completely reworked the connection dialog. Some changes are only related to the UI, but there are some new features as well.

General

We’ve re-arranged the fields here to make the connection process more user-friendly.

Comparing to the previous EAP build, password saving is now implemented via a drop-down. Now it has three options: Never, Until restart, and Forever. We are still thinking of adding some more options. Also, the empty password now can be set via UI: use the context menu.

06-PassWord

The Connection type field is what before was URL type. It determines the whole UI of this dialog, which is why now it’s on top along with the driver chooser.

The Database field goes after the credentials because sometimes credentials are needed to provide the database list. The list should be invoked by Ctrl/Cmd+Space.

05-General

Options

Read-only, Auto-Sync and Transaction control settings have been transferred here from the General tab.

Newly introduced settings:

Run keep-alive query every N seconds will help you keep the connection alive. You can define the custom query in the driver settings for unsupported databases.
Auto-disconnect after N seconds. Pretty self-explanatory.
The startup script is an SQL query which will be run each time you establish a connection. Remember that if the Single connection mode is unchecked, each new console creates a new connection.

04-Options

Renamed setting:

Warn if editing an outdated DDL is the new name for Notify when the outdated object is opened.

Schemas

– Object filter is transferred here from the Options tab.

02-ObjFilter

There’s a new Recent Locations popup that lists you recently visited/changed code locations. It presents them as code snippets with a couple of lines before and after the location.

This popup was inspired by Recent Files, but with an ability to search by visited code locations. This should come in handy when you remember what the code was about but can’t recall where it’s located. Especially if you work with several query consoles: they usually have similar names!

08-Recent

Press Delete/Backspace to remove locations from the popup.

The default shortcut for this popup is Ctrl/Cmd+Shift+E. If you’re used to pressing Ctrl/Cmd+Shift+E to call up Recently changed files, please use double Ctrl+E for that instead.

07-ShowEdited

Support for databases

We’ve implemented introspection and code generation for Greenplum. Even partitions, an important type of objects in Greenplum, are shown in the database tree view.

01-GP

DB2 now shows triggers in the database tree view.

03-Db2Triggers

Bug fixes:

DBE-2114: No more wrong COUNT() results in SQL Server. The driver problem isn’t fixed yet, so we’ve made changes on our side.
DBE-7743: Fixed error during introspection in MariaDB.

That’s all for today. Your feedback is extremely welcome in our twitter or forum.

Click Help -> Report problem… to raise a new issue in our issue tracker.

The DataGrip Team

Posted in Uncategorized | 5 Comments

DataGrip 2018.3.4

Hi! We have an update for 2018.3. Some bug-fixes are inside.

SQL formatter: we’re still improving it!

DBE-7362: Formatter works in SQL-injections.
DBE-7376: Better WITH formatting.
DBE-6937: Better arrays formatting in PostgreSQL.
DBE-4805: We keep the case of quoted identifiers in PostgreSQL.
DBE-7881: Support for ON CONFLICT clause in PostgreSQL.
DBE-7890: No more line break after PERFORM in PostgreSQL.
DBE-7605: INTO TEMP TABLE support in PostgreSQL.
DBE-7806: Better formatting for variables in SQL Server.

Other

During data import errors are written into a file by default.
DBE-7838: Fixed bug with missed reference when creating a foreign key.
DBE-7840: Autoscroll from the editor works correctly.
DBE-7896: No more raw HTML in notifications.

Posted in Uncategorized | Leave a comment

Top 9 SQL Features of DataGrip You Have to Know

DataGrip is a universal tool for dealing with databases. It supports PostgreSQL, MySQL, SQL Server, Oracle, and many other databases.

TOP9-2

DOWNLOAD A 30-DAY TRIAL FOR DATAGRIP

One of the most important activities for anyone working with databases is writing SQL. Built on IntelliJ Platform, DataGrip makes coding an enjoyable experience by automating repetitive tasks: as an SQL developer, you probably have many!

Let’s have a closer look at some of the nice SQL-related perks inside DataGrip.

1. Live Templates

DataGrip has code snippets called Live Templates. Use them to generate repetitive parts of SQL code.

There are some pre-built snippets for the most common tasks. Every live template has its own abbreviation — just type the abbreviation and then press Tab to fill in the rest of the code. For example, sel can be used for SELECT * FROM, while ins will provide the INSERT statement. Look at the Live Templates in action:

06_LiveTemplates

It is even possible to create custom templates for even greater efficiency. To do this go to Settings | Editor | Live Templates.

2. Introduce alias

This SQL refactoring is arguably one of the most important. Get your stopwatch ready as you are about to see how much time this saves you! Put the caret on the table name and press Alt+Enter (Opt+Enter for macOS) → Introduce table alias.

05-InlineRefactoring

3. Expand wildcard

Since using wildcards is not recommended in many cases, DataGrip can expand it to list all the columns of the table for you. In the event of conflicts, identifiers will be qualified with the table or alias names. JOINs are also respected!

01-ExpandWildcard

4. Postfix completion

This type of code completion is especially useful when real life doesn’t match the logic of how the code should be written. The best example is the SELECT statement: you need to think about the table you want to select fields from, and then you can decide which particular fields to select. Postfix completion lets you choose which order you do your coding.

An example would be if you type table_name.afrom you will get a list of all the table’s columns. Or, typing identifier.cast will generate the casting code for you.

02-PostfixCompletion

5. Multiple carets

Multiple cursors can be an efficient way to modify code. Especially in SQL, where similar rows are often used. To do this in DataGrip, press Ctrl (Opt for macOS) twice and hold it, then place new cursors with the arrow keys.

There is the option to place cursors everywhere matches have been found. Invoke Select All Occurrences by Shift+Ctrl+Alt+J (Ctrl+Cmd+G for macOS) when the caret is on the word you want.

03-MultipleCarets

Did you notice? The clipboard is also multiline!

6. Inline renaming

When you rename an object inside SQL, it also renames all the other usages of it inside your code. To rename, press Shift+F6.

05-InlineRefactoring

7. Abbreviation completion

Databases often have names with the same prefixes or first words which makes the normal kind of code completion not very useful: you may need to type the whole word to define a particular object. Abbreviation completion will save you here!

If you have names in camelCase or objects-with-hyphenated-names, just use the first letters of the words – it’s all you need, the rest will be completed with the suggestion.

04-Abbreviation

The same for keywords: ob works for ORDER BY.

8. Code formatting

You can have your SQL code formatted automatically, based on flexible user-defined code styles. Don’t spend time formatting legacy code – let DataGrip do it for you with a single shortcut Ctrl+Alt+L (Cmd+Opt+L for macOS)!

Adjust the code style in Settings | Editor | Code Style | SQL where you can, for example, define whether you capitalize keywords or not. Your style can be shared with your colleagues, so you are all working to the same standard.

07-Fromatter

9. Toggling comments

Toggle with your comments to make it easier to manage your code. Choose what type of comments you want to use – block or line-by-line (if it’s supported by your SQL dialect).

To comment with a line comment press Ctrl+/ (Cmd+/ for macOS).
To comment with a block comment press Ctrl+Alt+/ (Ctrl+Opt+/ for macOS).

08-TogglingComments

That’s it! We hope this article was useful for existing DataGrip users and also helps those who have never tried DataGrip learn a little bit about it.

DOWNLOAD A 30-DAY TRIAL FOR DATAGRIP

Some more information:
Tweet @ us!
— Discuss anything in the forum.
— Report bugs to our issue tracker.

Your DataGrip Team
_
JetBrains
The Drive to Develop

Posted in Features | 7 Comments

DataGrip 2019.1 EAP is started

For those eager to try the newest things, we invite you to join our Early Access Program for DataGrip 2019.1. As you may know, these builds don’t require a license – we just want everybody to try the new features out before the official release. Let’s go!

yCCKAB58

New databases: Greenplum, Vertica, and Apache Hive

In this release cycle, we focused a lot on supporting several new databases.

ThreeGraces

Greenplum is an analytics database based on PostgreSQL. It is currently developed by Pivotal and the open source community. For now, we have only SQL support for Greenplum; native database introspection will come later.

Vertica is column-oriented storage designed to handle large volumes of data.

Apache Hive is a data warehouse built on top of Apache Hadoop for providing data query and analysis.

Connectivity enhancements

Starting with 2019.1, the Test Connection button will not be disabled if there are no downloaded drivers. When you click Test Connection, DataGrip will offer you to download JDBC drivers.

TestConnection

We’ve also reworked the way passwords are stored, so now there are two options for Remember password:

Forever: Pretty self-explanatory. You will not be requested to enter the password again, period. Note the password will be stored separately (i.e. not within DataGrip).

For session: The password is saved until DataGrip is closed. Every time you re-open DataGrip, you’ll be requested to enter your password. Note this was the behavior when Remember was not selected, before v2019.1.

If you unselect Remember in 2019.1, entering the password will be required for every new connection. By default, every new console or data editor requires the new connection, unless you use Single Connection Mode.

Database tree view

We’ve improved database introspection for IBM DB2. You should now see these new objects in the database tree: module, data type, variable, condition, and global temporary table.

DB2

The tree itself now saves the context, so you’ll always see the data source name at the top.

TreeContext

We’ve also added icons for some databases we don’t support yet. Before, if you had many data sources of unsupported databases, they could all make a mess in the Database Tool window. Now we hope it looks a little bit better.

CustomLogos

We’ve added some combined options to the completion list for CREATE and DROP statements. For example, when you start typing CREATE, you can select CREATE TABLE.

CompletionCreate

One more benefit is that you can use abbreviations!

CompletionCaf

For MariaDB, DataGrip now highlights statements when running Oracle mode.

MariaOracle

For as long as we can remember, the Ctrl+Y shortcut has been assigned to Delete Line in the default Windows keymap. This seems to confuse many of our users because in many text editors, the Ctrl+Y shortcut is assigned to Redo. So, starting with 2019.1, when you first use the Ctrl/Cmd+Y keystroke, you will be prompted to assign the shortcut either to Delete Line or Redo. If you change your mind later, you can always customize the shortcut in Settings | Keymap.

Redo

Other

The filter in the data editor is now a little nicer: it offers you to use values from the clipboard.

FilterClipboard

We’ve added support for the DEFINER attribute in MySQL and MariaDB.

First, you can choose whether the SQL Generator should add a DEFINER attribute into the generated code.

SkipDefiner

Second, you may ignore DEFINER attributes during migration.

IgnoreDefiner

Bug fixes:

DBE-7640: Now you can set the default folder for a project.
DBE-7297: Tables in SQL Server were duplicated sometimes. No more.
DBE-7604: Schemas not chosen for introspection are not used in comparison now.
DBE-4993: Schema qualifier is no longer missed when creating the foreign key.
DBE-7560: Foreign key’s referenced column is no longer omitted in the Modify Table dialog.
DBE-4702: The Enable DBMS_OUTPUT button used in Oracle is back.
DBE-7443: Fixed the problem with temporary segments in Oracle.
DBE-6768: The source code of packages and functions is introspected properly.
DBE-7554: Fixed false positives while detecting unreachable code detection.

That’s all for today. Your feedback is welcome in our twitter or forum. By the way, this version introduces a handy feedback method: just click Help -> Report problem… to raise a new issue in our issue tracker!
The DataGrip Team

Posted in EAP, Features | Tagged | 22 Comments