sqls icon indicating copy to clipboard operation
sqls copied to clipboard

sqls formating removes all whitespaces

Open 594212 opened this issue 10 months ago • 5 comments

Expected Behavior

CREATE TABLE accounts (
  user_id SERIAL PRIMARY KEY, 
  username VARCHAR (50) UNIQUE NOT NULL, 
  password VARCHAR (50) NOT NULL, 
  email VARCHAR (255) UNIQUE NOT NULL, 
  created_at TIMESTAMP NOT NULL, 
  last_login TIMESTAMP
);

Actual Behavior

CREATETABLEaccounts(
    user_id SERIALPRIMARYKEY,
    usernameVARCHAR(
        50
    )UNIQUENOTNULL,
    passwordVARCHAR(
        50
    )NOTNULL,
    emailVARCHAR(
        255
    )UNIQUENOTNULL,
    created_atTIMESTAMPNOTNULL,
    last_loginTIMESTAMP
);

I'm not sure how it started, I was using nvim and setting up for postgres with lsqconfig, because I have same issue,for work around I added to ~/.config/sqls/config.yml following:

# Set to true to use lowercase keywords instead of uppercase.
lowercaseKeywords: false
connections:
  - alias: psql
    driver: postgresql
    dataSourceName: 'host=127.0.0.1 port=5432 user=postgres password=secret dbname=testdb sslmode=disable'

it's clearly not related to error, but after that in some point, formatter started going crazy. Now I removed all configs from every corner but this bug persists

594212 avatar Apr 13 '24 13:04 594212