xnuinside / simple-ddl-parser

Simple DDL Parser to parse SQL (HQL, TSQL, AWS Redshift, BigQuery, Snowflake and other dialects) ddl files to json/python dict with full information about columns: types, defaults, primary keys, etc. & table properties, types, domains, etc.
MIT License
179 stars 40 forks source link

IDENTITY clause in column definition not handled #184

Closed ctimmer closed 1 year ago

ctimmer commented 1 year ago

Describe the bug SQLServer - INDENTITY clause in column definition causes a problem with the entry size

To Reproduce Steps to reproduce the behavior: In the ddl: [cifno] [numeric](10, 0) IDENTITY(1,1) NOT NULL, puts (1,1) in the size field

Expected behavior Either ignore the IDENTITY clause or create a separate object entry for the identity value

Screenshots None

Desktop (please complete the following information):

xnuinside commented 1 year ago

@ctimmer hi! thanks for reporting the issue, I will fix it in next release

xnuinside commented 1 year ago

fix prepared in https://github.com/xnuinside/simple-ddl-parser/pull/195, I will comment one more time after version 0.30.0 will be released

xnuinside commented 1 year ago

@ctimmer just released version 0.30.0. Try it, test was added - https://github.com/xnuinside/simple-ddl-parser/blob/main/tests/dialects/test_mysql.py#L315. If will be needed something new - feel free to open the issue.