devtechedge opened a new pull request, #2618:
URL: https://github.com/apache/datafusion-sqlparser-rs/pull/2618

   `DO` blocks like `DO $$BEGIN RAISE NOTICE 'hi'; END$$` currently fail with 
"Expected: an SQL statement, found: DO".
   
   This adds `Statement::Do { language, code }` for PostgreSQL's 
[`DO`](https://www.postgresql.org/docs/current/sql-do.html) statement, gated 
behind a new `Dialect::supports_do_statement()` that is enabled for PostgreSQL.
   
   The code block must be a string literal (single-quoted, dollar-quoted, or 
`E''`), and `LANGUAGE lang` is accepted either before or after it, as the 
PostgreSQL grammar allows.
   
   Display normalizes to the documented `DO [ LANGUAGE lang ] code` order, and 
a repeated `LANGUAGE` is rejected.
   
   Tests in `tests/sqlparser_common.rs` cover both orders, the round trip, the 
error cases, and dialects without support.
   
   The implementation and tests were drafted with an AI coding assistant, and I 
reviewed the diff, ran the test suite and the fuzzer, and stand by the change.
   
   Fixes #2609
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to