How to tell PhpStorm that raw SQL statement is Clickhouse statement, not default project sql connection?

When I'm using raw clickhouse sql-statements in my code, PhpStorm trying to treat it like a common sql query, so I getting a lot of errors like "enable to resolve column" and "unknown database function". I can use annotation "@lang text" to supress errors, but then I'll lose SQL syntax highlighting. Is there a way to tell PhpStorm that following sql statement is clickhouse statement?

0
3 comments

Doesn't /** @lang ClickHouse */ do the trick?

1

Eugene Morozov yes it does, thanks! Don't know why I never tried to use capital letters "C" and "H". Is somewhere out there list of usefull annotations like "@lang", "@phpnoinspection" etc.? Never found one

0

There is completion for @lang, but weirdly enough, you have to enter the first character manually, and it has to be of the correct case, that's probably why you haven't found it yourself.
Generally, you can look up all injectable languages at Settings | Editor | Language Injections | + | Generic Php | ID.

As for @noinspection, it seems to make little sense to have completion there because usually you have an inspection hit you want to suppress, and doing so via the Alt+Enter menu seems much easier than picking an inspection from the completion list.

0

Please sign in to leave a comment.