vscode-sqltools icon indicating copy to clipboard operation
vscode-sqltools copied to clipboard

Weird formatting when queries contain `create` - or possibly caused by WSL?

Open Dzejkop opened this issue 3 years ago • 2 comments

Describe the bug When formatting a file with queries which contain create, the formatting removes spaces above said queries.

To Reproduce Using the default "preserve" setting for linesBetweenQueries.

Take and format the following file:

select *
from foo;

create table foobar (id INTEGER NOT NOT NULL PRIMARY KEY);

select *
from bar;

The result on my machine looks like this:

select *
from foo;
create table foobar (id INTEGER NOT NOT NULL PRIMARY KEY);


select *
from bar;

Expected behavior The formatting should respect the new lines between all queries.

Desktop (please complete the following information):

  • SQLTools Version 0.23.0
  • VSCode Version: 1.67.1
  • OS: Windows but running inside WSL (WSL os is OS: Ubuntu 20.04.4 LTS on Windows 10 x86_64 Kernel: 5.10.102.1-microsoft-standard-WSL2)
  • Driver:
    • [ ] PostgreSQL/Redshift
    • [ ] MySQL/MariaDB
    • [ ] MSSQL/Azure
    • [x] SQLite
    • [ ] Other? Which...
  • Database version: sqlite3 3.31.1 2020-01-27 19:55:54 3bfa9cc97da10598521b342961df8f5f68c7388fa117345eeb516eaa837balt1

Dzejkop avatar May 17 '22 18:05 Dzejkop

Does the advice at https://github.com/mtxr/vscode-sqltools/discussions/887#discussioncomment-3009193 about linesBetweenQueries help?

gjsjohnmurray avatar Jul 22 '22 22:07 gjsjohnmurray

I imagine that would work, but I don't necessarily want line breaks between all queries. Really I just want to preserve what I have.

Dzejkop avatar Jul 23 '22 12:07 Dzejkop