devtechedge commented on code in PR #2618:
URL:
https://github.com/apache/datafusion-sqlparser-rs/pull/2618#discussion_r4251293534
##########
src/ast/mod.rs:
##########
@@ -4930,6 +4930,17 @@ pub enum Statement {
channel: Ident,
},
/// ```sql
+ /// DO [ LANGUAGE lang_name ] code
+ /// ```
+ ///
+ /// See Postgres <https://www.postgresql.org/docs/current/sql-do.html>
+ Do {
+ /// Optional procedural language name.
+ language: Option<Ident>,
+ /// The anonymous code block, a string literal.
+ code: ValueWithSpan,
+ },
Review Comment:
Thanks @LucaCappelletti94!
I refactored it into a named `DoStatement` struct
(`Statement::Do(DoStatement)`), with its own `Display` and `From<DoStatement>
for Statement`, following the pattern of the other statement structs.
I also gave it a `Spanned` impl covering the language and code block, with a
small span test.
Parsing behavior and existing tests are unchanged, and fmt, clippy and the
full test suite pass.
Ready for another look whenever you have time.
--
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]