JSQLParser / JSqlParser

JSqlParser parses an SQL statement and translate it into a hierarchy of Java classes. The generated hierarchy can be navigated using the Visitor Pattern
https://github.com/JSQLParser/JSqlParser/wiki
Apache License 2.0
5.41k stars 1.34k forks source link

[Feature] Prostgres Procedural `DO $$BEGIN ... END$$` #1946

Open zdhuangelephant opened 10 months ago

zdhuangelephant commented 10 months ago

Always check against the Latest SNAPSHOT of JSQLParser and the Syntax Diagram

Failing SQL Feature:

SQL Example:

Software Information:

Exception in thread "main" net.sf.jsqlparser.JSQLParserException: net.sf.jsqlparser.parser.ParseException: Encountered unexpected token: "DO" "DO" at line 1, column 1.

zdhuangelephant commented 10 months ago

image

manticore-projects commented 10 months ago

Greetings!

PostgreSQL specific DO is not supported and you will need to provide or sponsor an implementation when you are interested in this particular feature.

zdhuangelephant commented 10 months ago

image is that not working ?

manticore-projects commented 10 months ago

is that not working ?

It is working by only passing through the text block. You would at least introduce a DO $$BEGIN ... END$$ statement and certainly you will want to parse this block in order to get the AST of your INSERT ... statement.