Fails to parse if DDL lacks semicolon or GO between statements.
n2ygk opened this issue · 4 comments
n2ygk commented
Describe the bug
Fails to parse some ddl if there's no semicolon or GO in between statements.
This silently fails to produce output:
DROP TABLE IF EXISTS sample
CREATE TABLE sample
(
sid BIGINT NOT NULL,
foo CHAR(5),
CONSTRAINT sample_key PRIMARY KEY NONCLUSTERED (sid)
)
While this succeeds (adds a semicolon).
DROP TABLE IF EXISTS sample;
CREATE TABLE sample
(
sid BIGINT NOT NULL,
foo CHAR(5),
CONSTRAINT sample_key PRIMARY KEY NONCLUSTERED (sid)
)
To Reproduce
sdp sample_ddl.sql
Expected behavior
Parser output or an error message or non-zero exit code.
xnuinside commented
hi @n2ygk to be honest )) before your issue I leave all the time with thoughts that between different statements you need separator or you will get syntax error )
n2ygk commented
I thought so too. Until I came across MS-SQL examples that work with SQLCMD.
…On Fri, Nov 12, 2021 at 1:50 AM Iuliia Volkova ***@***.***> wrote:
hi @n2ygk <https://github.com/n2ygk> to be honest )) before your issue I
leave all the time with thoughts that between different statements you need
separator or you will get syntax error )
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#90 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABBHS5YOZHKPCCTRYMWFXXLULS2LHANCNFSM5H3HEMEQ>
.
xnuinside commented
@n2ygk fixes for both issues were released in version 0.22.0 - https://pypistats.org/packages/simple-ddl-parser . If you will find anything more - please feel free to open new issue and thank you one more time!