Skip to content

cli/sql: avoid ad-hoc parsing to match special input cases #97508

Open
@knz

Description

@knz

In #94408 we've introduced a regular expression in the SQL shell.
In commit fb09e01 we've introduced a mini-parser in the SQL shell go package.

Both of these things are architecturally incorrect -- we should have the server inspect the SQL syntax, as only the server has precise knowledge of the grammar that it recognizes.

There's a couple of solutions we can consider:

  • lex and match the lexed tokens
  • extend SHOW SYNTAX to reveals the token (using parser.Tokens()) in addition to the parsed syntax / errors

Jira issue: CRDB-24732

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-cli-clientCLI commands that pertain to using SQL featuresC-bugCode not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.T-sql-foundationsSQL Foundations Team (formerly SQL Schema + SQL Sessions)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions