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

Parsing fails for GENERATED ALWAYS AS expressions that use a cast #198

Closed bholzer closed 4 months ago

bholzer commented 1 year ago

Minimal example:

CREATE TABLE test (
  timestamp TIMESTAMP,
  date DATE GENERATED ALWAYS AS (CAST(timestamp AS DATE))
)

Trying to dig into the code to see if I can issue a PR for this myself.

xnuinside commented 4 months ago

Hi! I'm not sure why I ignore this issues, sorry for that! @bholzer thank you for opening it and support for CAST added in version 1.2.1, test added - https://github.com/xnuinside/simple-ddl-parser/blob/main/tests/dialects/test_psql.py#L45. If will be any other issues, feel free to open new one and thank you again!