You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When trying out simple-ddl-parser on some existing DDL, I attempted to parse 4 CREATE statements but I would only get 3 results. No exception was produced. By process of elimination, I found that this line was the source of the issue:
created_timestamp TIMESTAMPTZ NOT NULL DEFAULT (now() at time zone 'utc'),
However. with the following, the CREATE statement is parsed as expected:
created_timestamp TIMESTAMPTZ NOT NULL DEFAULT (now()),
Which suggests that the issue is around the "at time zone 'utc'" portion of the DFEAULT clause.
To Reproduce
Parse a CREATE statement including a TIMESTAMPTZ column with a DEFAULT clause including at time zone 'utc'. NOTE: the specific time zone used does not appear to matter.
Expected behavior
The CREATE statement should be parsed and included in parsing results. Although this statement is valid Postgres DDL, I would expect an exception when a statement is not parseable or at something other than just ignoring the CREATE statement. I did not see anything in the documentation about error handling, I apologize if I have overlooked that.
Example code
from simple_ddl_parser import DDLParser
parser = DDLParser("""
CREATE TABLE example (
primary_key SERIAL PRIMARY KEY,
created_timestamp TIMESTAMPTZ NOT NULL DEFAULT (now() at time zone 'utc')
);
""")
result = parser.run()
print(len(result))
for r in result:
print(r["table_name"])
Expected output: 1 followed by the table name: 'example'
Actual output: 0
Desktop (please complete the following information):
OS: Windows10 (Gitbash/MINGW64)
Version 0.24.2
The text was updated successfully, but these errors were encountered:
@James-Matthew-Watson , hi! Thanks for explicit description & ddl samples. I will add support for statements with ‘at time zone’.
About the exception there is a another issue for that. Problem that there is no way really to identify issue why it is not parsed. So it will be error raise, but with common error like “Hey, looks like empty output in parser, possibly some statements unsupported”. Maybe without “Hey”)))
Description
When trying out simple-ddl-parser on some existing DDL, I attempted to parse 4 CREATE statements but I would only get 3 results. No exception was produced. By process of elimination, I found that this line was the source of the issue:
created_timestamp TIMESTAMPTZ NOT NULL DEFAULT (now() at time zone 'utc'),
However. with the following, the CREATE statement is parsed as expected:
created_timestamp TIMESTAMPTZ NOT NULL DEFAULT (now()),
Which suggests that the issue is around the "at time zone 'utc'" portion of the DFEAULT clause.
To Reproduce
Parse a CREATE statement including a TIMESTAMPTZ column with a DEFAULT clause including
at time zone 'utc'
. NOTE: the specific time zone used does not appear to matter.Expected behavior
The CREATE statement should be parsed and included in parsing results. Although this statement is valid Postgres DDL, I would expect an exception when a statement is not parseable or at something other than just ignoring the CREATE statement. I did not see anything in the documentation about error handling, I apologize if I have overlooked that.
Example code
Expected output: 1 followed by the table name: 'example'
Actual output: 0
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: