Skip to content

Replace acceptUnsupportedGrammar with conditional comments #125

@nene

Description

@nene

The acceptUnsupportedGrammar option doesn't really work well.

Should instead take another approach to allow skipping bunch of code. One option would be comments like this:

SELECT * FROM foo;
/* sql-parser-cst-disable */
CREATE TYPE float8_range AS RANGE (subtype = float8, subtype_diff = float8mi);
/* sql-parser-cst-enable */
CREATE TABLE tbl (pos float8_range NOT NULL);

This approach still has the issue that you would need to comment-out the whole statement, like the following would not work:

CREATE TYPE float8_range
  /* sql-parser-cst-disable */
  AS RANGE (subtype = float8, subtype_diff = float8mi);
  /* sql-parser-cst-enable */

But at least this would allow you to always disable the parsing for a statement, which the acceptUnsupportedGrammar doesn't achieve.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions