dbcli / mssql-cli

A command-line client for SQL Server with auto-completion and syntax highlighting
BSD 3-Clause "New" or "Revised" License
1.35k stars 191 forks source link

Multi-line statements now execute on 'GO' #396

Closed ellbosch closed 4 years ago

ellbosch commented 4 years ago

Closes #175.

Changes include:

Disclaimer: I have not accounted for an edge cause where a block comment may end on the same line as GO. For example, the following statement should execute but does not for us:

select 1 /* hey some comment
and the comment keeps going */ go

I have decided to forgo this edge case in favor of waiting for our dependency, sqlparse, to fix a bug that strips newlines from a method I'm using to strip comments (tracked here). I'm open to a discussion on this @udeeshagautam @chlafreniere.