Wisser / Jailer

Database Subsetting and Relational Data Browsing Tool.

Home Page:https://wisser.github.io/Jailer

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SQL statement detection incorrect while contain blank lines

acn-leoli opened this issue · comments

Description of the Issue

SQL statement detection incorrect while the SQL statement contains blank lines.

Steps to Reproduce the Issue

For example, below screenshot, the SQL contains blank lines between line number 6-9.

While the cursor in any line between line number 7-9, the "Run" button will be disabled, and the "Outline" panel shows nothing.

While the cursor in any line between line number 1-5 or line number 10, the "Run" button can be clicked but will have SQL syntax error as show in below screenshot, also, the SQL in the "Outline" panel missing the "as temp" part.

image

Expected Behavior

The blank lines should not impact the SQL statement detection, like how other SQL IDE tools do (eg. SQL Developer, MySQL Workbench, etc.)

Workaround

The current workaround can be either removing all the blank lines, or manually selecting the whole SQL before execution, which quite inefficient.

Hello,

the behavior described here is not an error, but the intended behavior. Even if it differs from that of some other tools, it has the advantage that a semicolon is not required after every statement.
It is important that the statement indicator on the left-hand side shows the statement boundaries correctly.
In addition to the manually removing blank lines method described by you, you can also format a statement. This also removes blank lines.

image

image

Thank you for the explanation and introducing the Format SQL function.

I still wish to have a setting/configuration that can change this behaviour to align to other tools' behaviour, because in my experience, while the SQL is very complicated or over 100+ rows, some blank lines between different section of logic can make the SQL more readable.

Btw, the tool is still great and thanks for your development!