Column comments containing `''` don't parse.
PBalsdon opened this issue · 2 comments
PBalsdon commented
Describe the bug
Parsing fails where column comments contain a pair of single quotes, ''
. This is used for column comments in snowflake to allow a single '
to appear in the definition.
To Reproduce
Parse the statement:
CREATE TABLE table (column_1 int comment 'This comment isn''t right')
Expected behavior
A standard parsing output:
Expected:
[{
'alter': {},
'checks': [],
'clone': None,
'columns': [{'check': None,
'comment': "'This comment isn't right'",
'default': None,
'name': 'column_1',
'nullable': True,
'references': None,
'size': None,
'type': 'int',
'unique': False}],
'index': [],
'partitioned_by': [],
'primary_key': [],
'primary_key_enforced': None,
'schema': None,
'table_name': 'table',
'tablespace': None
}]
Screenshots
Instead, we get the output []
Version
Latest
Additional context
I know this is snowflake syntax. Perhaps it is also true for other dialects, I'm not sure.
xnuinside commented
xnuinside commented
@PBalsdon 0.31.1 was released https://pypi.org/project/simple-ddl-parser/