Skip to content

Column comments containing '' don't parse. #208

@PBalsdon

Description

@PBalsdon

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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions