Summary
A blank line in a multi-line query causes the query editor to execute the text after the blank line as a separate SQL statement.
Steps to reproduce
- Connect to any database in sqlit.
- Enter the following query:
SELECT *
FROM schema_name.table_name
WHERE id < 1000
LIMIT 10
- Run the query from the editor.
Expected behavior
Blank lines are whitespace only, so the full query should be executed as one SQL statement.
Actual behavior
sqlit treats the blank line as a statement boundary. It runs the SELECT ... WHERE ... portion and then attempts to execute LIMIT 10 separately.
Notes
The same query works when the blank line before LIMIT 10 is removed. This makes normal SQL formatting with visual spacing difficult to use.
Suggested behavior
Could statement execution use one of these approaches instead?
- Split statements only on a SQL delimiter such as
;.
- Execute the statement containing the cursor, using SQL-aware parsing.
- Execute selected text when there is an active selection.
- Provide a configuration option for the statement separator/execution strategy.
This would allow users to retain normal formatting, including blank lines between clauses or CTEs, without changing query execution behavior.
Summary
A blank line in a multi-line query causes the query editor to execute the text after the blank line as a separate SQL statement.
Steps to reproduce
Expected behavior
Blank lines are whitespace only, so the full query should be executed as one SQL statement.
Actual behavior
sqlit treats the blank line as a statement boundary. It runs the
SELECT ... WHERE ...portion and then attempts to executeLIMIT 10separately.Notes
The same query works when the blank line before
LIMIT 10is removed. This makes normal SQL formatting with visual spacing difficult to use.Suggested behavior
Could statement execution use one of these approaches instead?
;.This would allow users to retain normal formatting, including blank lines between clauses or CTEs, without changing query execution behavior.