Zend\Db DDL Support For 2.2

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Zend\Db DDL Support For 2.2

ralphschindler
Hi all,

I wanted to open the discussion here about what DDL support might look
like in 2.2.

Before talking about API, first the outline as to why DDL abstraction
might be useful:

* application setup scripts
* application migration scripts
* development time prototyping - model first design
* integration testing (build up / tear down per test)

As you can see from my list above, none of those goals are intended so
that DDL objects are used during production time or the actual runtime
of an application.  As such, the classes/objects for this component, I
would suggest, be delivered inside the Zend\Db\Sql\Ddl namespace.

Some of the things that have the greatest platform-to-platform variability:

* datatype sets and datatype name variations
* support for compound statements (Foreign keys in Create table)
* table modifiers: (mysql engine, collations, etc)

That said, we need to identify the set of functionality for 2.2,
currently I have:

* CREATE TABLE $table ($column, ...);
* ALTER TABLE $table ADD|DROP|MODIFY $column|$constraint
* columns: SQL92-ish datatype support
* constraints: INDEX,PRIMARY KEY,FOREIGN KEY
* CREATE|REPLACE TRIGGER ...
* CREATE SEQUENCE
* DROP TABLE,TRIGGER,SEQUENCE

So, all that said, is there any other features we should consider before
we start talking about what the API might look like?


-ralph
Reply | Threaded
Open this post in threaded view
|

Re: Zend\Db DDL Support For 2.2

tbartolucci
This post has NOT been accepted by the mailing list yet.
What about UNIQUE constraint?
Reply | Threaded
Open this post in threaded view
|

Re: Zend\Db DDL Support For 2.2

Tomáš Fejfar
In reply to this post by ralphschindler
I'd love to see the abbility to change trigger (not in DB sense - that can't be done) but done by parsing the current trigger, changing something and than saving it back by DROP+CREATE / REPLACE. This is one thing that can't be done in plain SQL, but is integral part of the basic SQL DDL CRUD IMO

Tomas Fejfar, w3w.cz

twitter: @tomasfejfar
email: [hidden email]
www: http://www.tomasfejfar.cz



On Wed, Feb 13, 2013 at 4:50 PM, Ralph Schindler <[hidden email]> wrote:
Hi all,

I wanted to open the discussion here about what DDL support might look like in 2.2.

Before talking about API, first the outline as to why DDL abstraction might be useful:

* application setup scripts
* application migration scripts
* development time prototyping - model first design
* integration testing (build up / tear down per test)

As you can see from my list above, none of those goals are intended so that DDL objects are used during production time or the actual runtime of an application.  As such, the classes/objects for this component, I would suggest, be delivered inside the Zend\Db\Sql\Ddl namespace.

Some of the things that have the greatest platform-to-platform variability:

* datatype sets and datatype name variations
* support for compound statements (Foreign keys in Create table)
* table modifiers: (mysql engine, collations, etc)

That said, we need to identify the set of functionality for 2.2, currently I have:

* CREATE TABLE $table ($column, ...);
* ALTER TABLE $table ADD|DROP|MODIFY $column|$constraint
* columns: SQL92-ish datatype support
* constraints: INDEX,PRIMARY KEY,FOREIGN KEY
* CREATE|REPLACE TRIGGER ...
* CREATE SEQUENCE
* DROP TABLE,TRIGGER,SEQUENCE

So, all that said, is there any other features we should consider before we start talking about what the API might look like?


-ralph

Reply | Threaded
Open this post in threaded view
|

Re: Zend\Db DDL Support For 2.2

venca
This post has NOT been accepted by the mailing list yet.
In reply to this post by ralphschindler
Hi Ralph,

I think CREATE, DROP, ALTER view is very useful too.
Reply | Threaded
Open this post in threaded view
|

Re: Zend\Db DDL Support For 2.2

ralphschindler
In reply to this post by Tomáš Fejfar
I'm not sure I fully understand.  It sounds like you just want to drop
and recreate after you execute other statements?  Is this a platform
specific workflow?  Can you give me a bit more detail of the workflow?

-ralph

On 2/14/13 3:25 AM, Tomáš Fejfar wrote:

> I'd love to see the abbility to change trigger (not in DB sense - that
> can't be done) but done by parsing the current trigger, changing
> something and than saving it back by DROP+CREATE / REPLACE. This is one
> thing that can't be done in plain SQL, but is integral part of the basic
> SQL DDL CRUD IMO
>
> Tomas Fejfar, w3w.cz <http://w3w.cz/>
>
> /twitter: /@tomasfejfar <https://twitter.com/tomasfejfar>
> /email: /[hidden email] <mailto:[hidden email]>
> /www: /http://www.tomasfejfar.cz <http://www.tomasfejfar.cz/>
> //
>
>
> On Wed, Feb 13, 2013 at 4:50 PM, Ralph Schindler
> <[hidden email] <mailto:[hidden email]>> wrote:
>
>     Hi all,
>
>     I wanted to open the discussion here about what DDL support might
>     look like in 2.2.
>
>     Before talking about API, first the outline as to why DDL
>     abstraction might be useful:
>
>     * application setup scripts
>     * application migration scripts
>     * development time prototyping - model first design
>     * integration testing (build up / tear down per test)
>
>     As you can see from my list above, none of those goals are intended
>     so that DDL objects are used during production time or the actual
>     runtime of an application.  As such, the classes/objects for this
>     component, I would suggest, be delivered inside the Zend\Db\Sql\Ddl
>     namespace.
>
>     Some of the things that have the greatest platform-to-platform
>     variability:
>
>     * datatype sets and datatype name variations
>     * support for compound statements (Foreign keys in Create table)
>     * table modifiers: (mysql engine, collations, etc)
>
>     That said, we need to identify the set of functionality for 2.2,
>     currently I have:
>
>     * CREATE TABLE $table ($column, ...);
>     * ALTER TABLE $table ADD|DROP|MODIFY $column|$constraint
>     * columns: SQL92-ish datatype support
>     * constraints: INDEX,PRIMARY KEY,FOREIGN KEY
>     * CREATE|REPLACE TRIGGER ...
>     * CREATE SEQUENCE
>     * DROP TABLE,TRIGGER,SEQUENCE
>
>     So, all that said, is there any other features we should consider
>     before we start talking about what the API might look like?
>
>
>     -ralph
>
>

Reply | Threaded
Open this post in threaded view
|

Re: Zend\Db DDL Support For 2.2

Tomáš Fejfar
Something that would be called ALTER TRIGGER (analogy to ALTER TABLE). No such command is available in MySQL. You can CREATE or DROP triggers. You can't change them - so you need to parse it drop it and recreate it with new parameters. 

Tomas Fejfar, w3w.cz

twitter: @tomasfejfar
email: [hidden email]
www: http://www.tomasfejfar.cz



On Thu, Feb 14, 2013 at 4:27 PM, Ralph Schindler <[hidden email]> wrote:
I'm not sure I fully understand.  It sounds like you just want to drop and recreate after you execute other statements?  Is this a platform specific workflow?  Can you give me a bit more detail of the workflow?

-ralph

On 2/14/13 3:25 AM, Tomáš Fejfar wrote:
I'd love to see the abbility to change trigger (not in DB sense - that
can't be done) but done by parsing the current trigger, changing
something and than saving it back by DROP+CREATE / REPLACE. This is one
thing that can't be done in plain SQL, but is integral part of the basic
SQL DDL CRUD IMO

Tomas Fejfar, w3w.cz <http://w3w.cz/>

/twitter: /@tomasfejfar <https://twitter.com/tomasfejfar>
/email: /[hidden email] <mailto:[hidden email]>
/www: /http://www.tomasfejfar.cz <http://www.tomasfejfar.cz/>
//


On Wed, Feb 13, 2013 at 4:50 PM, Ralph Schindler
<[hidden email] <mailto:[hidden email]>> wrote:

    Hi all,

    I wanted to open the discussion here about what DDL support might
    look like in 2.2.

    Before talking about API, first the outline as to why DDL
    abstraction might be useful:

    * application setup scripts
    * application migration scripts
    * development time prototyping - model first design
    * integration testing (build up / tear down per test)

    As you can see from my list above, none of those goals are intended
    so that DDL objects are used during production time or the actual
    runtime of an application.  As such, the classes/objects for this
    component, I would suggest, be delivered inside the Zend\Db\Sql\Ddl
    namespace.

    Some of the things that have the greatest platform-to-platform
    variability:

    * datatype sets and datatype name variations
    * support for compound statements (Foreign keys in Create table)
    * table modifiers: (mysql engine, collations, etc)

    That said, we need to identify the set of functionality for 2.2,
    currently I have:

    * CREATE TABLE $table ($column, ...);
    * ALTER TABLE $table ADD|DROP|MODIFY $column|$constraint
    * columns: SQL92-ish datatype support
    * constraints: INDEX,PRIMARY KEY,FOREIGN KEY
    * CREATE|REPLACE TRIGGER ...
    * CREATE SEQUENCE
    * DROP TABLE,TRIGGER,SEQUENCE

    So, all that said, is there any other features we should consider
    before we start talking about what the API might look like?


    -ralph