DataGrip 2017.3.4
Here is the first bug-fix update this year. Many issues have been fixed, the most important of which are:
Collations are now placed after schemas in the database tree. If you want to hide them, put collation:-.* into Data source properties → Options tab → Object filter.
DBE-5703: А correct DDL statement is now generated when a PostgreSQL function with defaults is dropped.
DBE-5608: Amazon Redshift data source synchronization works now.
DBE-5404: The editor now recognizes the WITH NO SCHEMA BINDING
syntax in Redshift.
DBE-2465: FETCH ALL IN <cursor name>
doesn’t return errors anymore.
DBE-5274: FOR EACH ROW WHEN
in triggers shows the correct clause.
DBE-4983: SQL generator doesn’t add the ‘n’ character in new lines in Oracle anymore.
Fixed freezes:
DBE-2536: While introspecting schemas with many tables.
DBE-5532: After updating a function.
DataGrip team
Andrew says:
January 21, 2018DataGrip 2017.3.4 -> bug with tree view.
P.S. tree view does not correctly display table structure, column names and so on
Maksim Sobolevskiy says:
January 21, 2018Can you please share a screenshot along with the DDL of the object?
Matthias Theves says:
January 30, 2018Cannot automatically upgrade on Ubuntu 16.04
currently running “2017.3.2 (build 173.3942.44)”.
“Help\Check for Updates\” suggests me to download the new version
instead of upgrading the existing one.
Can i avoid this ? Don t want to manually import current connection settings.
Maksim Sobolevskiy says:
January 30, 2018If you don’t miss updates, you’ll be able to update by patches. In your case you missed 2017.3.3.
Anyway, when you install the new version, it offer you to migrate settings along with all the connections.
Even if you will need to migrate connections manually, use Context menu -> Database Tools -> Copy datasources to clipboard.
In the new version press + -> Import from clipboard
NAVI says:
February 8, 2018Hi!
I am using postgresql 10.1
Here is example:
CREATE SCHEMA test1;
CREATE TABLE test1.tb1 (id BIGINT PRIMARY KEY, value NUMERIC);
CREATE TABLE test1.tb2(id BIGINT PRIMARY KEY, tb1_id BIGINT REFERENCES test1.tb1, value NUMERIC);
When I generate DDL for test1.tb2 using SQL Generator (Ctrl+Alt+G), I get this:
CREATE TABLE tb2
(
id BIGINT NOT NULL
CONSTRAINT tb2_pkey
PRIMARY KEY,
tb1_id BIGINT
CONSTRAINT tb2_tb1_id_fkey
REFERENCES tb1,
value NUMERIC
);
So, there is no schema. But, I expect generated sql script to be:
CREATE TABLE test1.tb2 — schema name
(
id BIGINT NOT NULL
CONSTRAINT tb2_pkey
PRIMARY KEY,
tb1_id BIGINT
CONSTRAINT tb2_tb1_id_fkey
REFERENCES test1.tb1, — schema name
value NUMERIC
);
I tried to configure settings:
Qualify object on code competion with
Database/schema – Always
But, it didn’t help me.
How can I accomplish that? Thanks
Maksim Sobolevskiy says:
February 8, 2018Now there is no such possibility. Please, vote for the issue.
https://youtrack.jetbrains.com/v2/issue/DBE-5886
Auto-cmpletion setting is about auto-copmetion, not generation 🙂
NAVI says:
February 9, 2018Something interesting:
My collegue also uses DataGrip2017.3.4 (DB 173.4301.31, built on January 17, 2018).
And his copy works paritally:
CREATE TABLE test1.tb2 — his copy shows this schema name
(
id BIGINT NOT NULL
CONSTRAINT tb2_pkey
PRIMARY KEY,
tb1_id BIGINT
CONSTRAINT tb2_tb1_id_fkey
REFERENCES test1.tb1, — but, doesn’t show this one
value NUMERIC
);
Even more strange:
When i installed dataGrip for the first time (I mean the last version), it worked fine. After I “played” with settings, it stopped generating valid ddl with schemas. I tried to reinstall datagrip, with cleaning up all settings, but I couldn’t repeat that. So, I has concluded, maybe I missed some setting
Any way, thank you for your response. I voted 🙂
lb says:
February 9, 2018Hello, Navi.
Let me explain what’s happened.
DataGrip has a feature to qualify object names with schema name. This feature works, for example, for Oracle scripts. In the previous version of DataGrip it was available for all supported RDBMS.
In case of Postgres, however, DataGrip generates some kinds of objects by itself but for other ones it asks Postgres server for doing this job. The server has no API where we can specify whether it should qualify object names or not, and generated in such manner script looked inconsistent: table names were qualified but view names won’t. It confused SQL developers (and it was really hard to explain them why it add schema names for one objects and doesn’t for other), so I had to hide this feature.
So, related to the “CREATE TABLE test1.tb2” — your colleague seems uses an old or EAP version of DataGrip where this feature was enabled.
As of the qualifying names of referenced tables, such table is qualified when it located in non-current schema or not in schema of the referencing table. So, if both referencing and referenced tables are located in the same schema and this schema is current in the script context, references are not qualified, in other cases — qualified.
Hope it helps
Edoardo says:
February 9, 2018Is there a way to make autocompletion always insert qualified names?
I also noticed that if I compile a table or a procedure with Toad/DbBeaver, using a fully qualified name, when I open the DDL for that table/procedure with Datagrip, the name is not qualified anymore.
And when I compile a procedure with the CREATE OR REPLACE clause, Datagrip recognized and output only the CREATE on the DDL.
Am I doing something wrong?
Maksim Sobolevskiy says:
February 12, 20181. Yes. Go to Settings -> Editor -> General ->Smart keys -> SQL and turn the setting on.
2. How do you get the DDL? With SQL generator or in DDL tab? Now we are reworking getting DDLs and we hope to get them consistent.
3. This will also be fixed in new version, but now if you use SQL-generator , it should be ok. https://blog.jetbrains.com/datagrip/2017/12/06/datagrip-2017-3/#sql
Edoardo says:
February 12, 2018Points 2 and 3 are solved with SQL Generator, specifying the “… by RDBMS” option. It works but a single double click on the object would be a lot better!
Point 1 is solved also, but why not moving it on the Code style part?
Thank you so much for this product, it brings fun to develop SQL again.
When will the first EAP be available?
Maksim Sobolevskiy says:
February 12, 2018We are not sure that qualification is the part of code style 🙂
Edoardo says:
February 12, 2018At least not in the actual position! I searched a lot and had to ask you guys to find it! 😀
Maksim Sobolevskiy says:
February 12, 2018But what you needed to do is to type “qualify” in search fields, right? 🙂
Edoardo says:
February 12, 2018Yeah that was the right term to search with. I tried with “completion” and discared the “Smart keys” tab as it didn’t sound like the right place to search. My bad!