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
175 stars 40 forks source link

Not supported ddl #263

Closed franferri closed 1 month ago

franferri commented 1 month ago

Error:

simple_ddl_parser.ddl_parser.DDLParserError: Unknown statement at LexToken(ID,'TIME',1,133)

Config:

    parsed_ddl = DDLParser(ddl, silent=False).run(group_by_type=True)

DDL (postgres):

CREATE TABLE application_criteria ( application_criteria_id NUMERIC(8) not null, update_datetime TIMESTAMP WITH TIME ZONE not null, scientific_pi_application_id NUMERIC(8) not null, criteria_state_id NUMERIC(2) not null, employee_id VARCHAR(7) null, third_party_id VARCHAR(10) null, managed_group_id VARCHAR(2) null, criteria_id NUMERIC(3) not null, notes VARCHAR(1024) null, dsan_link VARCHAR(1024) null, ic_link VARCHAR(1024) null, CONSTRAINT pk_application_criteria PRIMARY KEY (application_criteria_id, update_datetime) );

CREATE TABLE criteria_state ( criteria_state_id NUMERIC(2) not null, CONSTRAINT pk_criteria_state PRIMARY KEY (criteria_state_id) );

ALTER TABLE application_criteria ADD CONSTRAINT fk_criteria_state_application_criteria FOREIGN KEY (criteria_state_id) REFERENCES criteria_state (criteria_state_id);

franferri commented 1 month ago

my bad, its supported, my version was outdated you rock!