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.
UNIQUE KEY statements currently cause the entire table to be ignored. IE UNIQUE KEY "fun_unique_key" ("fun_unique_column"), In this case I think we'd like a single column to parse into a column UNIQUE statement, and multiple columns to parse into the constraints.uniques location.
There appears to be a couple of problems with UNIQUE parsing.
constraints.uniques
with both columns listed in the columns. See https://www.mysqltutorial.org/mysql-basics/mysql-unique-constraint/#:~:text=To%20define%20a%20UNIQUE%C2%A0%20constraint%20for%20two%20or%20more%20columns%2C%20you%20use%20the%20following%20syntax%3AUNIQUE KEY
statements currently cause the entire table to be ignored. IEUNIQUE KEY "fun_unique_key" ("fun_unique_column"),
In this case I think we'd like a single column to parse into a column UNIQUE statement, and multiple columns to parse into theconstraints.uniques
location.