Disable auto quotes around table and column names
Using Autocomplete within DataGrip will wrap a table or column name with quotes. Here's an example:
SELECT * FROM "Table"
The issue is that running these statements results in a SQL syntax error. I have been manually typing everything in, effectively rendering the autocomplete useless.
How can I disable the auto-quotation feature?
Thanks!
Please sign in to leave a comment.
Hi,
Could you specify driver, dialect and database you're working with?
Thank you
I have this same issue, working with MS SQL Server.
Heres an example, for instance
This is still happening with latest DG 2017.1.5 MSSqlServer
Hi,
Do you invoke completion in a file or in a console? If you invoke completion in a file be sure to define SQL dialect correctly for the file.
Also, could you attach a screenshot of your Editor -> Code Style -> SQL settings, e.g.:
Currently, I can't reproduce your problem.
Thank you.
I have the same problem. It happens with any dialect and none of the SQL dialect quoting options seem to have any effect. I'm using 2017.2.2. It seems to happen on all column names which are in mixed case (e.g. msgDate).
Same problem here with datagrip or intellij
When querying all is ok:
When double tapping a table or using autocomplete though:
When
I'm having this issue in datagrip 2017.3 and 2017.3.1 with dialect set to oracle.
All autocompleted table and column names have quotes around them making all sql invalid.
@Zachary Goldstein Hi,
Could you provide sample DDL and query you use?
Also, it'll be useful to see your data source and driver settings.
Thank you.
I made a new table to recreate (note that all of our existing tables have this problem regardless of their structure):
create table tmp_zack (
case_type number(12)
) tablespace our_space
*Note that I issued the create statement outside of datagrip. I found that if I created the table from within a datagrip console then datagrip _did_ autocomplete it correctly (at least during that session)*
Back in datagrip in the database tool, I did "forget cached schemas" for my database connection then synchronized the schema.
Any query works:
e.g. select * from tmp_zack.
All auto completes on tmp_zack whether qualified the schema name or not add the quote marks around tmp_zack.
In the meantime I have rolled back to datagrip 2017.2.3 and it is working fine.
What pages do you want to see from the database and drivers settings? Do you have an email I can send logs to (and how do you want those settings dumped from datagrip?)
My Database connection is using the oracle driver.
This is the linked driver page:
Hi,
There is an issue https://youtrack.jetbrains.com/issue/DBE-5531 you can track and vote for.
It'll be helpful to get test connection details and a screenshot of your database tree.
Thank you.
I am also having this problem, but only with my Editor->Code Style->SQL-->General->Word Case->Quoted Identifiers set to "To lower".
Changing the next option (Identifier quotation) does not have any effect.
@KPowers Hi,
>> It'll be helpful to get test connection details and a screenshot of your database tree.
It could be that your database base casing is "To Lower"
Thank you.
Additional details in case they are useful:
DataGrip 2017.3.2
Build #DB-173.3942.44, built on December 15, 2017
Licensed to <snip>
JRE: 1.8.0_152-release-1024-b8 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Linux 4.4.0-101-generic
Test connection details:
Database: Oracle (ver. Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options) Identifier case sensitivity: upper (plain), exact (delimited) Driver (JDBC4.0): Oracle JDBC driver (ver. 12.1.0.2.0)
Database tree screenshot (is this what you mean by database tree?):
Note: in this screenshot I have changed my formatter settings to avoid the bug.
This issue is resolved in version 2017.3.4. Thank you!
Fixed for me too
This regressed for Datagrip 2019.3
@ Qiwei Uk ,
Could you specify what exactly regressed?
Pay attention, that there is a new option to control quotation in Code Style
vasily chernov
None of the options in `Quotation character` works, in 2019.3, every auto completion (tab) is quoted...e.g. the schema, table, column name....
This is a changed behaviour from 2019.2.x versions
Qiwei Uk,
Could you specify database you work with?
vasily chernov
This is on AWS Athena connection using drivers provided by AWS...(so it's actually Presto but similar to Hive), AthenaJDBC42_2.0.7.jar. And it's the only one with this behaviour (i.e. auto quoting on code completion).
I also tested on PostgreSQL connection, it works fine, same for a Spark JDBC driver.
I have similar issue after upgrade to 19.3 version on 19.2 was ok. When using autocomplete quotes are always specified if table names and columns are in lower case. I tried all possible preference changes (also those mentioned in the comments above), but none seem to work. The option Identifier quotation = Unquote does not work as expected.
The biggest problem is, that quoted strings are SQL syntax error, because there default schema is overwritten and schema is not contained in the SQL expression:
I managed to overcome this by specifying To upper for quoted identifiers - it seems that then option Unquote actually works. But this is not a "nice" solution.
@ Marko Polak ,
Could you specify database (dialect) you are working with?
I'm using GenericSQL. In Oracle dialect(different project) it works as expected - but part of my current project is Informix DB, that I had setup as Driver data source.
Something had to change from 19.2 to 19.3 version - after upgrade behaviour changed.
I'm having the same issue as Marko, I'm also using GenericSQL connecting to Informix.
I filed an issue https://youtrack.jetbrains.com/issue/DBE-9768