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!

25 comments
Comment actions Permalink

Hi,

Could you specify driver, dialect and database you're working with?

Thank you

0
Comment actions Permalink

I have this same issue, working with MS SQL Server.

Heres an example, for instance

select * from "app_event_type" where "event_type"='foo'

 

1
Comment actions Permalink

This is still happening with latest DG 2017.1.5 MSSqlServer

0
Comment actions Permalink

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.

 

0
Comment actions Permalink

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

1
Comment actions Permalink

Same problem here with datagrip or intellij

When querying all is ok:

When double tapping a table or using autocomplete though:

When 

1
Comment actions Permalink

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. 

1
Comment actions Permalink

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

0
Comment actions Permalink

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:

0
Comment actions Permalink

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.

1
Comment actions Permalink

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.

0
Comment actions Permalink

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

0
Comment actions Permalink

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.

0
Comment actions Permalink

This issue is resolved in version 2017.3.4.  Thank you!

1
Comment actions Permalink

This regressed for Datagrip 2019.3

0
Comment actions Permalink

@ Qiwei Uk ,

Could you specify what exactly regressed?

Pay attention, that there is a new option to control quotation in Code Style

0
Comment actions Permalink

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

1
Comment actions Permalink

Qiwei Uk,

Could you specify database you work with?

0
Comment actions Permalink

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.

0
Comment actions Permalink

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:

select * from "table_name";
[42000][-201] A syntax error has occurred.
[00000] java.sql.SQLException

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.

 

0
Comment actions Permalink

@ Marko Polak ,

Could you specify database (dialect) you are working with?

 

 

0
Comment actions Permalink

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.

1
Comment actions Permalink

I'm having the same issue as Marko, I'm also using GenericSQL connecting to Informix.

0

Please sign in to leave a comment.