LucaCappelletti94 opened a new issue, #2023:
URL: https://github.com/apache/datafusion-sqlparser-rs/issues/2023

   At the time of writing, as described earlier in issues such as #1388, the 
[CREATE TRIGGER](https://sqlite.org/lang_createtrigger.html) syntax for SQLite 
is not supported.
   
   For instance, once this feature is fully supported, I expect the following 
snippet to execute, while at this time it crashes with `ParserError("Expected: 
an object type after CREATE, found: TRIGGER at Line: 1, Column: 8")`.
   
   I will proceed with a PR attempt after determining what to do with #2020 and 
#2022.
   
   ```rust
   let to_parse = r#"CREATE TRIGGER trg_inherit_asset_models
   AFTER INSERT ON parent_procedure_templates
   FOR EACH ROW
   BEGIN
       INSERT INTO procedure_template_asset_models (
           name,
           procedure_template,
           based_on,
           asset_model,
           created_by,
           created_at
       )
       SELECT
           pam.name,
           NEW.parent,
           pam.id,
           pam.asset_model,
           NEW.created_by,
           NEW.created_at
       FROM procedure_template_asset_models pam
       WHERE pam.procedure_template = NEW.child;
   END;
   "#;
   let stmt =
     sqlparser::parser::Parser::parse_sql(&sqlparser::dialect::SQLiteDialect 
{}, to_parse)
         .unwrap();
   ```


-- 
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: github-unsubscr...@datafusion.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org
For additional commands, e-mail: github-h...@datafusion.apache.org

Reply via email to