On 19 Mar 2002 13:16:05 -0600, Jason Hildebrand wrote:
>On a number of occasions, I would have found it useful to be able to
>dump the entire MiddleKit object database to a file which I could
>later
>reload.
>
>I can do this with database tools (i.e. mysqldump, and later reload
>the
>file), but if I rearrange the ordering of the classes in my
>classes.csv
>file (for example by adding a new class), all the classids change, so
>the object references don't line up anymore after I reload the data.
>
>A solution would be to implement a "dump" which outputs the objects
>in
>the same format as the samples.csv file, so that MiddleKit can
>easily
>reload the objects, even if the classids change. �This "dump" could
>also
>be useful for making backups, or allowing the administrator to
>"tweak"
>data (or schema) and then reload it (which is useful in the
>design/development phase).
>
>I plan to implement this dump functionality -- but if someone has
>already done this, please email me right away (to save me the
>effort).
>
>peace,
>Jason

I have written such a dump routine for my internal project. Not
so general but maybe you can do something with it. I can e-mail
it if you want.

Note that if you have deleted any objects in the database the
standard Samples.csv format is not so good because the objects
always get consecutive ids from 1. You will loose the object
identities which may ruin object references.

Therefore I have added an id column like this (notice that
Foo with id 3 is deleted):

Foo objects
fooId,a
1,123
2,432
4,543

Bar objects
barId,foo
1,Foo.1
2,Foo.2
3,Foo.4

To make this new format work with MK I had to "extend" MySQLSQLGenerator.py.

/Stefan


_______________________________________________
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss

Reply via email to