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
183 stars 41 forks source link

Issue #236: Updates to handle stand-alone UNIQUE and UNIQUE KEY statements #237

Closed cfhowes closed 8 months ago

cfhowes commented 8 months ago

resolves #236

Updated parsing of UNIQUE and UNIQUE KEY clauses and statements. Now when multiple columns are specified in a UNIQUE clause/statement it will be treated as a compound UNIQUE statement and put in the constraints section of the parse dict. It also means that the individual columns will have unique=False since the individual column does not actually have a UNIQUE constraint. If I have done this correctly it will match the SQL spec more closely then before.

xnuinside commented 8 months ago

@cfhowes thanks for your PR, I can take a look on this weekends

xnuinside commented 8 months ago

@cfhowes thanks for amazing update