2009年4月14日星期二

Re: [fw-db] Create SQL script (export sql instead of execute)

Could you extend the db adapter to log instead of query maybe, could
be messy though :) Or maybe the dbprofiler, log the queries and then
post process them into deletes etc.

You may want to look at db migration tools such as DBDeploy also.

2009/4/14 lightflowmark <1@lightflowinterrupted.com>:
>
> Exporting the queries isn't tricky - $query->__toString() will do it for you.
> Creating the delete queries might be trickier, I've never tried anything
> like that.  Easy enough on inserts, I guess, as you can just capture the ID
> and create a delete based on that, but updates, especially nested updates or
> multiple updates on the same table, seem like more of a nightmare as you've
> potentially got order dependencies.  And you've always got the potential for
> leaving orphaned rows in databases - XREf tables without parent rows, that
> kind of thing.
>
> M
>
>
>
> Matthias W. wrote:
>>
>> Hi,
>>
>> I want to export a set of SQL statements into a SQL-Script instead of
>> executing the statements.
>>
>> Because I'm workin with modules and now I'm implementing an installation
>> script which executes SQL. While executing this SQL statements I want to
>> create the deinstallation SQL script. This means that I have to create the
>> delete-Statements when I create the insert statements, but the delete
>> statements must not be executed, they have to be logged in a file or in a
>> database table to be executed on deinstallation.
>>
>> Is this possible?
>>
>
> --
> View this message in context: http://www.nabble.com/Create-SQL-script-%28export-sql-instead-of-execute%29-tp23034599p23034980.html
> Sent from the Zend DB mailing list archive at Nabble.com.
>
>

--
----------------------------------------------------------------------
[MuTe]
----------------------------------------------------------------------

没有评论: