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

   This PR refactors several `Statement` enum variants into their own dedicated 
structs. This follows the pattern of recent refactors to improve the modularity 
and type safety of the AST.
   
   Specifically, the following statements have been extracted:
   
   - `CreatePolicy`
   - `DropPolicy`
   - `AlterPolicy`
   - `Grant`
   - `Revoke`
   
   I implemented `From<Struct> for Statement` and `fmt::Display` for each new 
struct.
   
   As done in PR https://github.com/apache/datafusion-sqlparser-rs/pull/2160 
and for the same reasons, I have updated parser methods to return the specific 
struct type instead of the generic `Statement` enum:
       - `parse_create_policy() -> Result<CreatePolicy, ...>`
       - `parse_drop_policy() -> Result<DropPolicy, ...>`
       - `parse_alter_policy() -> Result<AlterPolicy, ...>`
       - `parse_grant() -> Result<Grant, ...>`
       - `parse_revoke() -> Result<Revoke, ...>`
   
   This PR does not yet cover all Statement struct variants that likely should 
be converted into tuple variants, we'll get there in time.
   
   Luca


-- 
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