DataGrip 2017.1.4 is Out

Hi! We have a small update for DataGrip 2017.1, with a few fixes that will be important for some of you:

DBE-4570 – Trigger editor works properly now.
DBE-4282 – Fixed bug with wrong column order in MySQL.
DBE-2338 – Introspection in Sybase became faster. Thanks to Ian Moult for offering a better query to run!

Stay tuned!
DataGrip team.

Posted in Uncategorized | 4 Comments

DataGrip 2017.1.2

Hi! A new update for DataGrip 2017.1 is out.

The most important fixes in this update are:
– DBE-4387 – The bug with enrcypt() values for INSERT in PostgreSQL is fixed.
– DBE-4467 – Broken code generation for not officially supported databases is fixed.
DBE-4444 – Cursor loop statements in procedures are now supported.

There are several ways to update your version of DataGrip: using the Check For Updates… menu or by downloading the new version from our web site; however, the most convenient way to keep your IDEs from JetBrains updated is Toolbox App!

ToolBox

Your DataGrip Team

Posted in Uncategorized | Leave a comment

How to Find Things in DataGrip

Search and navigation tips

When you work with a software tool, you often need to find something or other. In DataGrip, you could be looking for things like:

Database objects: tables, views, procedures, columns and so on.
Data: enough said.
Code: for example a piece of code in a big script or the source code for a database object.
Lots of other things: files, settings, IDE actions, etc.

Finding what you need easily is crucial to user experience, which is why we focus heavily on making search and navigation intuitive in DataGrip. Let’s look closer at how not to get lost in the IDE and your databases.

Database objects

First, any tree (list, pop-up, drop-down) in IntelliJ-based IDEs supports speed search. Simply start typing! Note though that a matching database object will only be highlighted if its node is already open.

Another nifty thing about speed search is that supports abbreviations. For instance, ‘fa‘ is enough to find ‘film_actor‘.

Navigate to any database object with Ctrl+N (Alt+O for OS X) such as a table, view, procedure, etc. Just type the name or an abbreviation of the object you need. Ctrl+Alt+Shift+N (Alt+Cmd+O for OSX) includes more objects in the search scope like column, indexes etc.

If you are looking for a table or view, Enter will open the data editor (with a DDL tab in case you need the code), while F4 will switch you to the object in the database tree.

Same goes for functions or procedures: press Enter to edit the source code, or F4 to jump to the location in the database tree.

And a small tip for searching for the columns in any result-set or table. Open Structure view by Ctrl+F12 and start typing! Speed search saves you again and filter columns. Press Enter to navigate to the particular column.

data

To quickly find data inside a table, without writing a statement, call up text search with Ctrl/Cmd+F. It’s especially helpful if you don’t know which exact column contains the data you’re looking for. You can see only rows with matches if you prefer.

Note that this searches only within the current page of the result-set. To configure the page size of the result set, go to Settings → Database → Data views → Result page size. Enter -1 to avoid paging. But remember, that it can affect the performance of the queries.

PageSize

When working with a table, enter a filtering condition written in SQL in the corresponding field, as if you were writing it a WHERE clause.

FIlters

This field can be automatically populated from the context menu.

FilterContext

code

Find is of course a must-have feature for any editor. As usual, in DataGrip it is available via Ctrl/Cmd+F.

What many people don’t know (including some at JetBrains!) is that completion works here as well. Press Ctrl+Space to complete the value, based on the words you have in the current context. Set multicursors on the search results: Ctrl+Alt+Shift+J (Ctrl+Cmd+G for OSX).

Notice the settings icon, which lets you exclude comments and literals, or conversely search only within comments and literals.

Find1

Find in path (Ctrl/Cmd+Shift+А) looks for code in other consoles, attached files and even in the source code of views and routines.

In our example, if you select ‘In Project‘, it only looks for code in dump files attached to the project. But if you choose ‘All scopes,’ it will also look inside source codes and thus locate the procedure in our database.

Find usages in the context menu of the object (or press Alt+F7) will show you where it is used, be it scripts or source codes of other projects. In our example, the actor table is found in dump-files, database consoles with different queries and several objects: one rule and three views.

FindUsages

Other stuff

To navigate to a file with the specified name press Ctrl+Shift+N (Shift+Cmd+O for OSX).

FindFile

Speed search works in Settings as well. Earlier in this post we described the way to set the page size; follow the same steps to locate this setting.

Find action (Ctrl+Shift+A) will lend a helping hand when the going gets tough. By the way, it also searches in settings, so ‘Result page size‘ setting can be found here as well.

What’s most important, if you know something is possible in DataGrip but you don’t know how access it, just type it here. For instance, if you forget how to open a new console, press Ctrl/Cmd+Shift+A, type “open new console” and press Enter. Voila!

When all hope is lost, go with ‘Search everywhere‘. This feature makes it possible to look for any item in databases, files, actions, elements of the user interface, etc., all via a single action. Below, ‘actor‘ takes us not only to various database objects, but to the ‘Refactor‘ action as well. The refactoring can be performed from the drop-down with the search results.

Define the scope of ‘Everywhere’ with the gear icon.

SettingsScopes

When all else fails, tweet at us. If DataGrip can do it, we’ll find it for you!

Your DataGrip Team

Posted in Features, Tutorial | Tagged , | Comments Off on How to Find Things in DataGrip

DataGrip 2017.1 Released!

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

DataGrip_20171@2x_splash

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

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

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

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

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

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

Below come the details.

Database tree

New schema management

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

00-—-SchemasPopup

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

03-—-NewSchemaManagement

SQL resolution scopes

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

04 — SQLResoultionScopes

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

Create database/schema UI

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

01 — AddSchema

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

02 — TrackCreation

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

New options in color settings

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

05 — ColorSettings

SQLite better introspection

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

06 — SQliteIntroscpetion

Import/export data

Import dialog enhancements

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

01 — ImportMappings

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

02 — ImportDDL

Export/import tables

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

03 — DragnDropTables

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

04 — ExportResultSet

Query console

Respect the default search path

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

00 — SearchPath

Better triggers support

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

01 — GenerateTrigger

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

02 — TriggerInserted

Code assistance

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

03 — ValueHints

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

05 — QualifyOnColllisions

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

EnterWithConcat (2)

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

EnterWithoutConcat

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

04 — QualifyIntroscpector

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

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

07 — ParametersNAmedCompletion

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

08 — AliasCasing

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

09 — StatementSeparators

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

13 — UnionError

Jump to colors and fonts

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

10 — FindActionText

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

11 — JumpToStringToken

Here you are!

12 — StringTokenPrefs

 

Database objects

Modify table UI improvement

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

02 — ModifyTable

Tracking source code changes

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

01 — LocalChanges

Documentation link for system tables in PostgreSQL

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

03 — PgDocument

SQLite views

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

04 — ViewSQlite

Miscellaneous

More information in result-set status bar

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

01 — QueryTime

Text occurrences in Find Usages

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

02 — FindUsagesOptions

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

03 — UsagesOfText

Other

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

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

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

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

Posted in Releases | Tagged , , , , | 32 Comments

DataGrip 2017.1 RC is Out!

Hi there,

All IntelliJ-based IDEs are rushing to the 2017.1 release, and here is our DataGrip 2017.1 RC. Many new things were added since the latest EAP, so let’s see what’s new inside.

Create database/schema

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

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

TrackCreation

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

The Generate menu (Alt+Ins/Cmd-N) also contains a Schema and database now.

 

Find usages

Here we have a new option to include or exclude text occurrences.

FindUsagesOptions

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

UsagesOfText
Source code editing

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

LocalChanges

 

We’ll be happy if you try this build and follow us not to miss the huge blog-post about all new features in this release!

DataGrip team.

Posted in Uncategorized | 2 Comments

DataGrip 2017.1 EAP 3

Hello!

In this post I’ll tell you what our team has been doing in February and what the latest EAP build brings to DataGrip 2017.1.

SQL resolution scopes

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

Resolution

Now, you can simply map any file or folder to any datasource in Settings → Database → SQL resolution scopes. This means that all unqualified objects will be resolved to the selected datasource/database/schema. The project level mappings are the same as Options → Resolved unqualified references in previous versions. All your settings set there will transit here, so you won’t lose them.

Respect the default search path in PostgreSQL

Before, we set the search path according to the context of the console opening. At some point we discovered it wasn’t very convenient for many of our users. Now the default search path is set for any console. You can change it in any moment or go back to the default one.

Search-path

Editor

The color setting of the datasource can be applied to the editor as well. We hope this will help you avoid running test scripts on your production databases.

Colors

If you enable this option in Settings → Editor → Appearance → Show parameter name hints, DataGrip will prompt you about column names in INSERT statements.

Hints

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

Separator

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

Jump-to

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

ChooserJumpTo

Here you are.

ColorSettingFonts

Statistics

Query time is now shown in the status bar.

TimeQuery

We’ve added some statistics to the notification you get after import from file is finished.

StatsAndError

Also, the error message in importing now contains a row/symbol number and shows actual/expected symbols.

Other important fixes

— Single quotation mark is now escaped in DDL
— Read-only preview is available for large file
— Emoji support
— Warnings are added on the Output tab as soon as they’re raised
— Commit triggers synchronization in PostgreSQL
— Correct line endings are sent to the database in SQL Server

Take DataGrip EAP for a spin!

Your DataGrip Team

Posted in Uncategorized | Tagged | 8 Comments

DataGrip 2017.1 new EAP build

Hello! It’s time for the new EAP build for 2017.1 which is going to be released later this March. There are several notable features, let’s take a look at them.

Schema management

We are still working on the schema selection UI. Now it’s a tree with the ability to choose the current schema. Of course, if the current schema is changed in some other place, DataGrip will show the new one.

SchemasPattern

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

Import CSV

First: Drag-n-drop csv files to the datasource.

Second: Import zipped CSV files.

ImportCSV

Remember that the process information is available on the Database tab of Event Log. We added a link to the error file.

ImportErrors

Also, importing itself has become much faster. For instance, a 50 MB file was imported for 2 minutes. Now it takes just 10 seconds.

Other enhancements

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

ModifyTable

Data Source color (Context menuColor settings) now affects the console and result tab toolbars.

Colors

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

Aliases

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

MySQL

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

Your DataGrip Team
_
JetBrains
The Drive to Develop

 

Posted in EAP, Features | Tagged , , | 9 Comments

DataGrip 2016.3.3 is here

Hello! A minor update for DataGrip 2016.3 is out.

The most notable enhancements are:

The Drop action in the context menu for schemas.

DropSchema

We removed the Drop action from the context menu of the objects which cannot be dropped by DataGrip.

This build also comes with the following improvements:

— The random switch-off of Auto-commit has been fixed
Long lines on Oracle routines are no longer truncated

Update your version of DataGrip using the Check For Updates… menu or just download the new version from our web-site.

Please keep reporting problems to us if there are any.

Your DataGrip Team
JetBrains
The Drive to Develop

Posted in Features, Minor updates | 4 Comments

DataGrip 2017.1 Early Access Program Started

Hello! The new year has already brought us a new version of DataGrip, as today we start the Early Access Program for DataGrip 2017.1. Everybody can try this free build and take the new possibilities for a spin:

Сolumns mapping in CSV
Drag-n-drop tables
Smart options for SQL editing
Code insight
SQLite introspection
Miscellaneous

Let’s see what these enhancements are about.

Сolumns mapping in CSV import

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

ImportMapping

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

ImportDDL

Drag-n-drop tables

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

DragnDrop

Smart options for SQL editing

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

SmartOptions

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

SmartConcat

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

SmartLiteral

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

SameTables

The table persons is present in both schemas and the table cardvendors is only in max. Here are examples corresponding to the different values in Qualify object in completion:

– Always
CompletionAlways
– On collisions
CompletionCollisions
– Never
CompletionNever

Code insight

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

Inserted

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

NamedParamCompletion

Also, the CREATE OR ALTER construction, which appeared in SQL Server 2016, is now supported as well.

CreateOrAlter

SQLite introspection

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

SqliteDBView

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

SQLiteView

Miscellaneous

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

GenerateTrigger

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

Documentaion

TNS names are correctly parsed from tnsnames.ora file in Oracle. This means that the completion is available in this field of the connection window.

TNS

Other enhancements

Zero-latency typing is now enabled by default
– Icons for synonyms are seen in structure view and completion
– It’s possible to use routine parameters in LIMIT in MySQL
– Customized colors are used for syntax highlighting of regular expressions

That’s all for today. Your feedback is welcome in our twitter, forum, and the issue tracker. Let us know what you think about DataGrip 2017.1!

Your DataGrip Team
_
JetBrains
The Drive to Develop

Posted in EAP, Features | Tagged , , , | 7 Comments

DataGrip 2016.3.1 is Out

Hi! Thank you for your feedback about our 2016.3 release. This is the first minor update.

Fixed bugs:

DBE-2147 — Sometimes columns width is extremely narrow

bugfix

DBE-3562 — Routine/Trigger editor does not drop object before running

DBE-3605 — OSX connection to SQL Server does not accept password

And one enhancement:

Since it is possible to submit changes in bulk by Ctrl/Cmd+Enter starting from 2016.3, many users asked to add the submit button. Done!

submit

Please update your version of DataGrip from Check For Updates… menu or just download a new version from our web-site. Please, keep reporting problems to us if there are any.

Your DataGrip Team
JetBrains
The Drive to Develop

Posted in Minor updates | 6 Comments