Skip to content

Handle Go keyword for TSQL#67

Open
ettingshausen wants to merge 1 commit into
vertical-blank:masterfrom
ettingshausen:master
Open

Handle Go keyword for TSQL#67
ettingshausen wants to merge 1 commit into
vertical-blank:masterfrom
ettingshausen:master

Conversation

@ettingshausen
Copy link
Copy Markdown

Handle Go keyword as reservedNewlineWords.

Origin SQL.

alter table t1 add n_col int null 
go 
update t1 set c_con=0

before

ALTER TABLE
    t1
ADD
    n_col int NULL go
UPDATE
    t1
SET
    c_con = 0

after:

ALTER TABLE
    t1
ADD
    n_col int NULL
GO
UPDATE
    t1
SET
    c_con = 0

@Gwaptiva
Copy link
Copy Markdown

Confirming that we ran into this exact issue with the integration of sql-formatter 2.0.5 in our tool, when SQL Server GO batch separators get glued to the following CREATE INDEX. Applied this patch locally and verified it fixes our ouput. Would appreciate a merge into the mainline

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants