Skip to content

[feature] Refactor SQL statement parsing #226

Open
@mirromutth

Description

@mirromutth

Is your feature request related to a problem? Please describe.

For now, query is parsed by Query.parse. It can locate parameter indexes, map parameter names, and reformat prepared statements.

But it has no ability to know what the statement should be, for example:

  • Can a RETURNING clause be appended to the statement?
  • Does the statement contain RETURNING clause?
  • Is the statement a INSERT .. VALUES .., and can it be rewritten as a bulk insert?

So the parser should be improved to support basically syntax analysis.

This will help implement #136 and provide the ability to add RETURNING clause checks

Describe the solution you'd like

Add basically syntax analysis for Query parser.

Additional context

See also #201 issuecomment-1894821758

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions