[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.
Please sign in to leave a comment.
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:
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
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?
UPDATE:
It appears that everything works as intended in the database console, just not in .sql files. Hope that helps.
Still not reproducible with Generic SQL dialect:
Should I just reinstall?
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.
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.
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.
I've cleared out the third party plugins and it's fixed. Thanks!