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

New EAP build of 2016.3: bulk submit, improved drivers management, renaming views and more.

$
0
0

Hi there! It’s time for the new EAP build for 2016.3 which is going to be released later this November. There are several interesting features inside, so without further ado let’s take a look at them.

Bulk submit changes

You’ve waited a long time for this way of editing data, and here it is: Now all your changes are stored locally and can be submitted at once. Local changes are colored, so you can see which changes you are going to save, be it updating, inserting or deleting rows. As usual, Ctrl/Cmd+Z is for canceling.

safe-edit

If you want to bring back the behavior of previous versions, turn it on in Settings.

submitimmi

Driver management

Now DataGrip underlines your datasource if the version of the driver is not the latest. If you really wish to use the particular version of the driver, tweak it in driver settings. Also, you can uncheck “Use provided driver” and use only files added to the Additional list. Otherwise, files in this list will be used with the provided driver.

olddrivers

Renaming views

DataGrip now supports renaming views: As with tables, if you rename the view it will affect the object in the database and all its usages in open files.

renameview

XML extractor

Back in 0xDBE times (remember those?) we had an XML-extractor. Some of you asked to bring it back, and we’ve obliged.

xmlmenu

Here what the extractor’s result looks like:

xmlresult

SQLite support

Some improvements in SQLite support: modify table dialog now lets you add an auto-increment. Yeah, the way it’s done is tricky, but that’s how SQLite actually works!

auto_inc

Expression index in SQLite is not a problem for DataGrip anymore.

expressionindex

Besides all of the above, this build brings:

  • PostgreSQL 9.6 grammar support
  • Table resolve for SELECT * INTO in stored procedures
  • Correct resolving in type creation in Oracle

Please know, your feedback is always welcome in our twitter, forum and the issue tracker.

Your DataGrip Team
_
JetBrains
The Drive to Develop


Connecting DataGrip to SQL Server Express LocalDB

$
0
0

First you need to check if you LocalDB instance is ready for connection. Locate SqllocalDB.exe and run the SqllocalDB.exe i command in terminal. You will see the list of available LocalDB instances on the server which you are connecting to.

01-console-info

Say we want to connect to the v11.0 instance. First we need to check its state by running SqllocalDB.exe i v11.0 command.

02-console-instance-info

As you can see by examining the State field, right now the instance is stopped. Remember that by default every LocaDB instance is terminated after several minutes of inactivity. This behavior can be changed, but now we need to start the instance by running SqllocalDB.exe s v11.0

03-console-instance-start

It’s ready, so let’s launch DataGrip.

Invoke the database view by pressing Alt+1 and click + to add a new datasource, then choose SQL Server (jTds).

newdatasource

In the connection window we first select LocalDB in the dropdown next to the URL field. Then we go to the Instance field and select the instance to connect to, in our case, v11.0.

localdbchoosing

Then, go to the Advanced tab and find the DOMAIN option and set it to the name of the machine where the instance is installed. If the instance is on your local machine, use the name of your computer.

domainchoosing

The only thing left to do is to enter the access credentials and then click Test connection.

testsonnection

Voila!

result

Your DataGrip Team
_
JetBrains
The Drive to Develop

 

More source codes! New EAP of DataGrip 2016.3

$
0
0

Hello! We have a new EAP build out which is very important.

Now DataGrip shows triggers and views source code and lets you find usages of tables/views inside other views, stored procedures and functions.

So how does that work? The IDE loads the source code of major types of objects and puts them into local storage. This opens up many new possibilities, so let’s briefly go over them.

To make this storage work, please re-synchronize your data source. Select Forget Schemas, and then click the Synс/Refresh button.

forgetschemas

OK, now you’re ready. Most importantly, now you can find usages of objects inside the source code of other objects. For instance, you can learn in which stored procedures, functions or views your table is used. As usual, press Alt+F7 on the table name or call it from the context menu.

findusagescontext

In the Usages window you can see a preview of the objects, i.e. the source code of the objects where your table is used.

findusagesresult

What else? We’ve fixed many bugs related to source code. Now DataGrip shows it for triggers in all popular management systems: MySQL, PostgreSQL, SQL Server, Oracle and Sybase.

triggersource

View code is also shown correctly in all places. In addition to Copy DDL, there is a new action in the context menu now: Open DDL in Сonsole.

openddlinconsole

When you edit the source code of any object, DataGrip tracks your changes and highlights edited rows in the left editor panel. If you click on a highlighted row, a small toolbar is displayed with a Show Diff link. Click it to see the difference between the row you’ve changed and the one from the source code.

gutterdiff

If there are lots of changes in many places, you can see all of them from the Database Changes window. Any individual change can be clicked to display the diff viewer as well.

diffchanges

Remember that you can manage which source codes will be loaded (or none at all) in the Options tab of datasouce properties, or from the context menu for many datasources at once.

sourceloadoptions

That’s all for now! Please try all these new changes and let us know your opinion about them. We need to know your thoughts to polish all this before the official release in late November.

Your DataGrip Team

 

Another EAP build: Data conversion, materialized views in PostgreSQL and more

$
0
0

Bonjour! We are rushing to the release and here is a new bunch of features you can already try in the DataGrip 2016.3 EAP.

The most notable feature of this build is data conversion. Now you can copy-paste your data even if the fields have different types of data, and moreover, even if the tables are in different databases from different vendors!

Since this release also brings you multiple cells edit, this will work with the whole column of data as well. Date to string, bool to integer — not a problem. Our loyal EAPers already know: edited rows are colored and stored locally before you submit your changes. Well, with 2016.3 you’ll get a powerful data editor, won’t you?

convertgifbig

Select Next Occurrence (Alt/Ctrl+G) action now works in data editor. Even if several cells are selected.

findoccurence

PostgreSQL users will be glad to know that we now fully support materialized views. It means that DataGrip lets you edit their source code, refresh them from the UI, and search for usages of objects inside them. And just a reminder: finding usages inside views is also a new feature of 2016.3. Please remember to refresh the schemas of your database to get this support.

matviews

Triggers, which are also supported in this version, now can be dropped from the UI.

droptrigger

If you run large script files from the context menu, please know that now they are executed much faster.

runscsipts

And maybe you’ve already noticed the new icons! We hope you like them.

icons

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

Your DataGrip Team
_
JetBrains
The Drive to Develop

DataGrip 2016.3 RC is Out

$
0
0

Hi! We are rushing to the release in the end of November, and here is the release candidate for 2016.3!

Among various bug-fixes a couple of new features were added since the last EAP:

Navigate to the next method, familiar to many of you from our other IDE’s now works in DataGrip. It’s called Navigate to the next statement and should be invoked by Alt+Down and Alt+Up (Ctrl+Down and Ctrl+Up for OSX).

navigation

If you run large script files from the context menu, please know that now they are executed much faster.

fasterrunscripts

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

DataGrip 2016.3 Released!

$
0
0

Hello, everybody!

This release cycle was really important for DataGrip — triggers support, find usages inside views/procedures, bulk submitting of changes: all these features were long-awaited and we thank everybody who helped us provide them in the right way during our EAP program. We are excited to release DataGrip 2016.3!

announce

As usual, everything described here is also available in 2016.3 version of IntelliJ IDEA, PyCharm, RubyMine and PHPStorm, except one small feature we will tell you about.

Here we go!

Source code storage

Now DataGrip shows triggers, views, and materialized views source code. Also, IDE lets you find usages of tables/views inside other views, stored procedures, and functions.

How does that work? The IDE loads the source code of major types of objects and puts them into the local storage. This opens up many new possibilities, so let’s briefly go over them.

To make this storage work, please re-synchronize your data source. Select Forget Schemas, and then click the Synс/Refresh button.

forgetschemas

You’re ready. Most importantly, now you can find usages of objects inside the source code of other objects. For instance, you can learn in which stored procedures, functions or views your table is used. As usual, press Alt+F7 on the table name or call it from the context menu. In the Usages window you can see the preview of objects, i.e. the source code of the objects where your table is used.

What else? We’ve fixed many bugs related to source code. Now DataGrip shows it for triggers in all popular management systems: MySQL, PostgreSQL, SQL Server, Oracle, and Sybase. We also added the Drop action to the context menu.

triggerssupport

View source code is also shown correctly in all places. In addition to Copy DDL, there is a new action in the context menu now: Open DDL in Сonsole.

openddlinconsole

We didn’t forget about materialized views in PostgreSQL: their source code is now available, and materialized views can be refreshed from the UI.

materializedviews

When you edit the source code of any object, DataGrip tracks your changes and highlights edited rows in the left editor panel. If you click on a highlighted row, a small toolbar is displayed with a Show Diff link. Click it to see the difference between the row you’ve changed and the one from the source code.

gutterdiff

If there are lots of changes in many places, you can see all of them in the Database Changes window. Please note that this window is available only in DataGrip, not other IntelliJ-based IDE’s.

databasechangesmenu

Any individual change can be clicked to display the diff viewer as well.

databasechanges

Remember that you can manage which sources will be loaded (or none at all) using the Options tab of data source properties, or from the context menu for several data sources at once.

loadsourcesmenu

Other enhancements connected to database objects support are:

  • Views can be renamed using Ctrl+F6 (Cmd+F6 for OSX).

renameviews

  • Operator’s signature in PostgreSQL is shown in the database view.

operatorssemantic

  • Comments in creating procedures/functions DDL are now saved to the database.

commentprocedures

Data editor

A lot of new features of this version are related to the data editor. The first and the most important: now all your changes are stored locally and can be submitted at once. Local changes are colored, so you can see which changes you are going to save, be it updating, inserting or deleting rows.
Submit changes by Ctrl+Enter (Cmd+Enter for OSX).  As usual, Ctrl+Z (Cmd+Z for OSX) is for canceling, but works in a tricky way — only the selected changes are canceled. If you wish to cancel all of them, select all cells by Ctrl+A (Cmd+A for OSX) before reverting.

bulksubmit

Several fields can be edited at once: just select them and begin to type. Of course, it works only if the columns you are editing are not unique and have the same type.

mordor

We added data conversion. Copy-paste your data even if the fields have different types of data, and moreover, even if the tables are in different databases from different vendors!

Since multiple cells edit is also available, this will work with the whole column of data as well. Date to string, bool to integer — not a problem.

conneversion

The familiar editor’s action called Select next occurrence by Alt+J (Ctrl+G for OSX) works here now, even if several cells are selected.

nextoccurence

Another familiar Expand selection action by Ctrl+W (Alt+Up for OSX) works in the data editor like this: first, a field is selected, then the column of the active field, then the row of the active field, and finally, the whole grid.

growselection

Code insight

The INSERT statement completion offers you not only the list of all fields but also the list of fields which have no default value.

completionwithputdefaults

The IDE will warn you about an unused variable or parameter in the function.

unusedinspection

Another inspection will let you know if there is a different number of columns in queries used in set operators (UNION, INTERSECT and EXCEPT).

unioninspection

The new intention action offers you to introspect the schema or databases right from the editor if DataGrip has no metadata on them yet.

introspectmissing

Some specific features for PostgreSQL users: when you use JOIN USING, DataGrip offers you only the field names common for both tables.

usingcompletion

Find Usages now handles positional parameters references: $1 will be treated as the first parameter’s usage and so on.

findusagesbucks

Navigate to the next method, familiar to many of you from our other IDE’s, now works in DataGrip and is called Navigate to the next statement.  Invoke it by Alt+Up and Alt+Down (Ctrl+Down and Ctrl+Up for OSX).

navigation

Data Dump

We integrated DataGrip with mysqldump and pg_dump. To dump the objects, use the Dump with… option from the context menu.

dumpcontext

This is what the dialogue window for MySQL looks like:

dumpmysql

And here is the one for PostgreSQL. Note that in both cases you can use completion for the console parameters.

dumppostgres

XML extractor comes back

Back in 0xDBE times (remember those?) we had an XML-extractor. Some of you asked to bring it back, and we’ve obliged.

xmlcontext

Here what the extractor’s result looks like:

xmlresult

Other features

When large script files are run from the context menu, now they are executed much faster.

fasterrunscripts

Now DataGrip detects if an old driver is in use and offers you to update it.

driverversions

You might have noticed the new icons! We hope you’ll like them.

icons

Other fixes and enhancements in this release include:

  • SQL Server 2016 grammar support
  • PostgreSQL 9.6 grammar support
  • Many minor objects can now be dropped from the UI
  • Many minor objects are now resolved in the SQL code
  • Rules support in PostgreSQL
  • External tables parsing in Oracle
  • The FiraCode font is bundled
  • Auto-inc support in SQLite
  • Expression index support in SQLite

That’s it! Get your 30-day trial of DataGrip today if you haven’t yet, or just enjoy the new features of DataGrip if you’re our user already. Your feedback is welcome in our twitter, forum, and the issue tracker. Let us know what you think!

Your DataGrip Team
_
JetBrains
The Drive to Develop

DataGrip 2016.3.1 is Out

$
0
0

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

DataGrip 2017.1 Early Access Program Started

$
0
0

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


DataGrip 2016.3.3 is here

$
0
0

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

DataGrip 2017.1 new EAP build

$
0
0

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

 

DataGrip 2017.1 EAP 3

$
0
0

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

DataGrip 2017.1 RC is Out!

$
0
0

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.

DataGrip 2017.1 Released!

$
0
0

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. All your settings configured there will transit here, so you won’t lose them.

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

How to Find Things in DataGrip

$
0
0

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

DataGrip 2017.1.2

$
0
0

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


DataGrip 2017.1.4 is Out

$
0
0

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.

We Open DataGrip 2017.2 EAP

$
0
0

Hello! We’re opening the Early Access Program for DataGrip 2017.2 so you can try new features before the next official release. In this cycle there are many that we really need your feedback on during the development process. See for yourself:

Amazon Redshift and Microsoft Azure support
Several databases in one PostgreSQL data source
Evaluate expression
Miscellaneous

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 nearly the same as SQL Server, so we just added a dedicated driver and UI for adding the data source.

But with Amazon Redshift, 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

In general, this means that if some part of your Redshift code is highlighted as an error but in fact isn’t, we consider it as 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-expected 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 can still be missing. Please give us 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 about several databases.

Evaluate expression

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

On 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.

Merge Visible

Miscellaneous

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

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

SwtichResult-sets

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

MySQLSwitcher

Objects are resolved by their OID values in PostgreSQL.

OIDs

Sequences are resolved in scripts as well.

Sequence

Other

— Fixed bug with renaming schemas.
— Fixed bug with renaming sequences in PostgreSQL.
— 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.

Your feedback is welcome in our twitter, forum, and the issue tracker. Let us know what you think about the upcoming DataGrip 2017.2!
Your DataGrip Team

DataGrip 2017.2 EAP 2 build

$
0
0

Hello! It’s time for the new EAP build for 2017.2 that is going to be released this July. Let’s take a look at several new features.

We’ve supported embedded Redshift functions that are absent in PostgreSQL.

RedshiftFunctions

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

Completion now works for columns in table-valued functions.

TableValued

Other fixes:
— Fixed a bug in composite primary key editing.
— Fixed a bug about a wrong error message in queries with GROUP BY.
— Lines with two identical results are merged in Find in Path.

As usual: twitter, forum, issue tracker. Please, download DataGrip 2017.2 and share your feedback!
Your DataGrip Team

DataGrip 2017.2 EAP 3 build

$
0
0

Hello! A new build of DataGrip 2017.2 EAP is available. It brings a small but a 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.

Screen-Shot-2017-06-16-at-15.01.45

We improved the introspection for Amazon Redshift which is now incremental. This means that only modified objects will be refreshed in a database tree after any operation instead of all objects.

Also, generation of DDL scripts for tables and functions has been enhanced.

Now DDL for tables contains the following attribute:

[ BACKUP { YES | NO } ]

column_attributes:

[ DEFAULT default_expr ]
[ 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 }

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

Your DataGrip Team

 

Working with SQL and Databases in IntelliJ-based IDEs webinar follow-up

$
0
0

We hosted our very first webinar on Wednesday, July 14th. Thanks to all who joined us and especially those who asked questions. We hope it all was useful for you and your feedback on the webinar is very welcome!

Here is the recording. Let me briefly describe what we talked about.

Creating a simple query: Live templates, code completion, expand column list.
Subqueries: Surround with, executing options, compare result-sets.
Data editor: Bulk sumbit, multiple submit, foreign keys navigation, transpose view etc.
Data extractors: Text extractors, SQL extractors, INSERTs batch editing, etc.
Navigation and search: Finding objects in the database, text in the source code, data in the table, column in the result-set.
User parameters.
Questions and answers.

Introduction

DataGrip is a standalone IDE for SQL based on IntelliJ Platform. All of DataGrip’s features are also available in other IDEs from JetBrains like IntelliJ IDEA, PhpStorm, PyCharm, RubyMine, as well as the upcoming Rider and Gogland. DataGrip supports the most popular databases, and will add support for Amazon Redshift and Microsoft Azure this July.

Creating a simple query 🔗

Live templates let you insert frequently-used or custom code constructs into your scripts. You can create your own, too!

LiveTemplate

We highlighted several types of code completion, the most interesting being abbreviation completion and JOIN statement completion.

The IDE can complete your statement in a JOIN clause if the tables are connected with a foreign key.

JOINcompletion

Abbreviation completion lets you type abbreviations of database objects to use them in your code. For example fica for film_category, or gabi for getAuthorByID.

Fica

Expand column list lets you use the list of columns instead of wildcards.

Wildcard

Subqueries 🔗

To surround one query with another, or to make a common table expression, use the Surround With action by Cmd/Ctrl+Alt+T. Func(exp) means that the caret will be placed before the parentheses, not after.

SubQueries

DataGrip lets you define what particular query you wish to execute after pressing Cmd/Ctrl+Enter: only a subquery, the whole statement where the caret is, or the whole script.

ExecutionOptions

If you have two result-sets, they can be compared in Diff Viewer.

DiffTables

Data editor 🔗

The grid is editable: when you observe table data, you can apply any changes just like you would in Excel. All your changes are stored locally and can be submitted at once. Local changes are colored, so you can see which changes you are going to save, be it updating, inserting or deleting rows. Submit with Ctrl+Enter. Ctrl+Z is for reverting, but works in a tricky way — only the currently selected changes are canceled. If you wish to cancel all changes, select all cells with Ctrl+A before using Ctrl+Z.

BulkSubmit

Several fields can be edited at once — just select them and begin typing. Of course, it works only if the columns you are editing are not unique and have the same type. Copy and paste works here as well.

MultipleSubmit

Use foreign keys navigation to see referencing data. For example, when you press Cmd+Down/F4 on the actor_id field with some particular value, you see the list of referencing tables. In our case it was only the film_actor table. Choose ‘referencing rows only’ and see the rows with actor_id = 6. Obviously, it’s just the list of films where the actor with id = 6 took part in. And again, pressing Cmd+Down/F4 on any row can bring you to this film’s row in the film table.

The Transpose view option lets you, surprisingly, transpose data! In other words, it flips your table: rows become columns and vice versa.

Transpose

Data extractors 🔗

Any result-set or data can be extracted in many ways. The most obvious one is the CSV format. Just choose the extractor and then extract the data to the file or to the clipboard. Extracting to the clipboard is also mapped for the Copy action (Cmd/Ctrl+C), and this is what we use for the demonstration.

Paste your CSV data anywhere you want to. We used a scratch file – a temporary file which can be created at any moment just from the IDE.

ScratchFiles

There are several text formats to export data in, including JSON, HTML, and XML. You can even create your own format with Groovy. Existing extractors can be found in Files (Cmd/Ctrl+2) → Scratches → Extensions → DataGrip → data → extractors.

JsonExtractors

Here are a couple of useful extractors: SQL Updates and SQL Inserts. You data will be presented as a batch of SQL statements. We showed a couple features which can help when you edit a batch of INSERT statements. First, ‘Edit as Table’ — select all statements you need to edit and choose this option from the context menu. Then, in a temporary table, edit the values you’re going to insert.

EditAsTable

Another way to edit several statements at once is multiple cursors. The easiest way to place them is to press Alt/Ctrl twice, hold it and press the Up or Down arrow keys.

Multicursors

You can navigate to the declaration of any resolved symbol with Cmd/Ctrl+Click, whether it is located in your SQL code or in the database.

NavigatebyClick

Navigate to a database object (like a table, procedure and so on) by pressing Cmd+O/Ctrl+N. If it is a table, a table editor will open. Cmd+Shift+O/Ctrl+Shift+N will bring you to any file.

CtrlNavigation

Ctrl+F will find text in the editor, which is trivial. What’s not trivial is that Ctrl/Cmd+Space will invoke the code completion based on the words in the corresponding file!

FindCompletion

Ctrl+F in the data editor helps you quickly find data inside a table, without writing a statement. 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.

FindData

A small tip for searching for columns in any result-set or table: Open Structure view with Ctrl+F12 and start typing! Speed search saves you again and filters the columns based on what you’ve typed. Press Enter to navigate to a particular column.

FindColumns

User parameters 🔗

When you get an SQL query from another application, it can be parameterized. DataGrip supports running this kind of queries. The UI for editing parameter patterns is available in Settings/Preferences → Database → User Parameters. Regular expressions are highlighted and you can choose in what dialect these patterns are valid.

UserParameters

That wrapped up the main part of the webinar.

Questions and answers

(the most interesting ones)

30:03
Q: Do you plan to support Hive or Impala?
A: DataGrip can connect to any database which has a JDBC-driver. It means that you can connect to Hive or Impala, see tables and other objects, and run queries. Special features of these kind of database are not supported and their syntax is not correctly highlighted. There is an issue in our tracker about adding the possibility to define custom dialects in DataGrip.

31:02
Q: What about version control systems?
A: DataGrip supports Version Control Systems like Git, SVN, Mercurial and some others. But this support doesn’t come out of the box: you need to install a JetBrains plugin for it. Go to Settings → Plugins → Browse repositories and search for the plugin you need. This plugin will bring first-class support for any VCS you need.

Git

32:00
Q: Do you plan to add more management tools?
A: Not any time soon. We are focusing on developers for now, but we will consider adding administration support later.

32:57
Q: Is there a way to share data sources from DataGrip to other IDEs?
A: Select the data sources you want to share and then go to context menu → Database Tools → Copy Settings.

CopySettings

Press + to add a new datasource and choose Import from Clipboard. During the webinar I said that this feature would be coming in the new version, but it’s also available in 2017.1.4 as long as datasource information is already copied to the clipboard.

ImportFromClipboard

It didn’t work during the webinar only because I didn’t actually press Copy Settings.

47:15
Q: Is it possible to record DDL and DML actions?
A: We are thinking about logging all queries coming from DataGrip. The only thing we offer now is the Modify Table window, where all your changes to the table are reflected in the generated script.

ModifyTable

49:20
Q: Can users configure the CSV format and use the custom delimiter?
A: Sure, simply choose Configure CSV formats… from the extractors drop-down.

51:15
Q: Is there a way to load CSV files to the database?
A: There are several ways to do that. The most common is to choose ‘Import data from file’ from the context menu of your database or schema. Or, you can just drag and drop your CSV file to the appropriate place in your database.

58:05
Q: What about data visualization, like graphs or pie-charts?
A: Sorry, there is no data visualization in DataGrip.

58:55
Q: Can we compare result-sets from different data sources?
A: Yes, you can.

That’s it! Thank you for your time, and if you’d like to have a webinar on a particular topic, let us know!

Your DataGrip Team

Viewing all 267 articles
Browse latest View live