Error that is not an error
I am getting an error detected by DataGrip that is not an error:
select top 10 * <-- squiggly here
from main.my_table
The red squiggly line says: <expression> expected, got 'from'
When I execute, the query goes through and brings back results.
Lately I have been using SQL Workbench but I missed the static analysis capabilities of Microsoft SQL Server. So I was really excited about DataGrip when I heard about it. So it's really disheartening that such a simple snippet of code would falsely detect an error.
Does DataGrip always run queries regardless of potential detected errors? Or does DataGrip ever elect to not execute a statement that it deems to be "incorrect"? Because if it is the latter case, then that is a deal breaker.
请先登录再写评论。
Seems to work ok, can you provide the screenshot if it still gives the error?
I need to mention that in any case if DataGrip detects the error where there is no error, you can select the whole statement and run it.
Hello Maxim,
It was my own error. I was connecting using a PostgresSQL driver. Thus the correct syntax is:
I suppose the confusion was because my original query was still running.
So, I am happy that all is ok :)
While we're on this topic, I have some DDLs for Amazon Redshift.
In the above, the keywords distkey and encode are both highlighted as errors. Do you know if this error also has to do with the driver? If so, what the resolution is?
Samuel, we don't support specific things for Redshift. So if some syntax is ok for Redshift but not ok for Postgres, we will treat it as an error. So, for now the only way to run it is select → run.
Also you can vote here: https://youtrack.jetbrains.com/issue/DBE-1459
I have some problem
@Niklstanislav2 Turn off one of this injections: https://pp.userapi.com/c830309/v830309772/1094cf/rFEga-ezzfc.jpg