[SQL] 'AS' Keyword for Table Aliases

Answered

IntelliJ Idea's code inspections flag the use of the 'AS' keyword for table aliases with an error 'expected: OF'. 


Placing the cursor and hitting option-enter doesn't give me the option to toggle this inspection, turning off inspections entirely for SQL doesn't change it, and this occurs with my SQL dialect set to both generic SQL and redshift. The result is that the code inspection for SQL is essentially completely useless, as there's just a cascade of errors everywhere with the editor failing to parse the code entirely after the alias.

0
9 comments

What IDE version do you use? How is the data source configured?

Is it possible to share a sample project to reproduce this issue?

I've tried it with the basic SQL file and can't reproduce:

0
Avatar
Permanently deleted user

I'm on IntelliJ Idea Ultimate 2018.2.1 Build #IU-182.3911.36. 

I can share a sample project.

https://drive.google.com/drive/folders/17tt2iYFgVOe49OJMdFOAam2k9VkL6pgL?usp=sharing 

results in I've also noticed that create table syntax is broken, resulting in 

and

Running 'Inspect Code' however tells me 'no suspicious code found."

Some other random SQL problems include autocompletion changing my keywords to lower case despite capitalization in code style being set to "do not change" , and indentation ignoring my settings entirely and being inconsistent between .sql files and the database console. Is it possible that SQL setting for my installation are somehow borked in general?

0
Avatar
Permanently deleted user

UPDATE:

It appears that everything works as intended in the database console, just not in .sql files. Hope that helps.

0

Still not reproducible with Generic SQL dialect:

0
Avatar
Permanently deleted user

Should I just reinstall?

0

Move/rename IDE folders to start with the defaults (https://intellij-support.jetbrains.com/hc/articles/206544519), create a new project from scratch, place .sql file there, change dialect to Generic SQL.

0
Avatar
Permanently deleted user

I did that. It gave me the splash screen, I chose not to import any settings, went through the ordinary setup steps. The same errors are still cropping up.

0

Your screenshot shows the third-party Database Navigator plug-in. Are you sure it's a clean install with no third-party plug-ins? Please double check: http://www.jetbrains.com/idea/webhelp/enabling-and-disabling-plugins.html.

0
Avatar
Permanently deleted user

I've cleared out the third party plugins and it's fixed. Thanks!

0

Please sign in to leave a comment.