[Phpmyadmin-devel] XML export/import : view of view

Dieter Adriaenssens dieter.adriaenssens at gmail.com
Mon Dec 27 14:50:15 CET 2010


2010/12/25 Marc Delisle <marc at infomarc.info>:
> Le 2010-12-25 06:35, Dieter Adriaenssens a écrit :
>> Hi all,
>>
>> I'd like your opinion about exporting view of view in xml format.
>>
>> Aamir Khan prepared a patch [0] that creates an XML export in the way
>> this is handled in SQL export, ie first all tables and views are
>> exported. All views are exported as standin tables with the same
>> structure. Then all views are recreated, first dropping the standin
>> tables, and creating the real views. The reason for this is to make
>> sure that when creating a view that uses another view, it at least
>> exists, thus avoiding an error upon importing it again.
>> Downside of this is that the xml export of the structure schema gets a
>> bit confusing with a <pma:table>, <pma:drop> and <pma:view> tag for
>> every view, as the xml export is intended to be used by custom
>> scripting.
>>
>> Another idea is just to export the schema structure with one tag for a
>> view (without the extra table and drop parts), and make some changes
>> to the xml import code, to handle the correct creation of the views.
>
> Has a patch been contributed to implement this second idea? If not, how
> complex would be "some changes"?

There is no patch yet.
Currently the import/xml.php code executes the SQL statements that are
defined in the structure schema in the exported XML file (see
attachment for an example, which was generated with Aamir's patch).
'Some changes' would mean that the import would have to detect a view
and generate the stand-in table for it, and after creating all
tables/stand-in views, executing the SQL statements to create the real
views (and add a a DROP statement of that stand-in table)

It doesn't seem to be too complex.

>>
>> Any ideas?
>>
>>
>> [0] http://sourceforge.net/tracker/?func=detail&aid=3141565&group_id=23067&atid=377410
>>
>
>
> --
> Marc Delisle
> http://infomarc.info
>
> ------------------------------------------------------------------------------
> Learn how Oracle Real Application Clusters (RAC) One Node allows customers
> to consolidate database storage, standardize their database environment, and,
> should the need arise, upgrade to a full multi-node Oracle RAC database
> without downtime or disruption
> http://p.sf.net/sfu/oracle-sfdevnl
> _______________________________________________
> Phpmyadmin-devel mailing list
> Phpmyadmin-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/phpmyadmin-devel
>



-- 
Groetjes,

Dieter Adriaenssens
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test_view_of_view.xml
Type: text/xml
Size: 2240 bytes
Desc: not available
URL: <http://lists.phpmyadmin.net/pipermail/developers/attachments/20101227/aad80ff6/attachment.xml>


More information about the Developers mailing list