Doctrine DBAL
  1. Doctrine DBAL
  2. DBAL-587

Support for Triggers, Views, Procedures

    Details

    • Type: Improvement Improvement
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Security Level: All
    • Labels:
      None

      Description

      Schema should have support for triggers, views and stored procedures. Since this is not standardizable accross platforms easily, the idea is to allow arbitrary SQL DDL Statements to be registered on a Schema, maybe even qualified by platform.

      $artifact = new SQLArtifact();
      $artifact->setName('some_view_name');
      $artifact->create('CREATE VIEW IF NOT EXISTS foo SELECT 1');
      $artifact->drop('DROP VIEW foo');
      $artifact->setPlatforms("mysql"); // accepts string or array, if nothing is set applies to ALL platforms.
      $schema->addSQLArtifact($artifact);
      

      During the SQL generation for the schema, the following will be appended to the currently generated SQL:

      DROP VIEW foo;
      CREATE VIEW IF NOT EXISTS foo SELECT 1
      

      The drop part of the statement is always rendered before the create statement in the Create Schema Visitor. In the Drop schema listener only the drop part is used.

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            Benjamin Eberlei
            Reporter:
            Benjamin Eberlei
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated: