On Monday 27 August 2007, Tobias Schlitt wrote: > Hi Fred and all others! > > On 07/23/2007 11:28 AM Frederik Holljen wrote: > > eZ component: DatabaseSchema, Design, 1.3 > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > > > :Author: Frederik Holljen > > :Revision: $Rev:$ > > :Date: $Date:$ > > :Status: Draft > > > > .. contents:: > > > > Introduction > > ============ > > > > Version 1.3 of DatabaseSchema will include scripts that support: > > - outputing a database schema > > - writing a database schema to a database > > - outputing a database diff > > - writinga database diff to a database > > - schema validating > > > > The corresponding issue in the issue tracker to this design document is > > #010534. > > > > Design description > > ================== > > > > The implementation will consist of five scripts and will use ConsoleTools > > for handling of parameters. The scripts in this proposal are writtin in > > UNIX style accepting intput from STDIN and writing to STDOUT by default. > > > > Saving a database schema > > ------------------------ > > > > The script will have the following parameters and options: > > > > dbschemasave SRC > > > > SRC is the full DSN of the database to read from. > > > > -f, --format=FORMAT One of xml[default], php. > > -n, --native-format=FORMAT Overrides -f, one of db handler names. > > -t, --target-file=FILE Path to filename to write output to. > > > > By default it will write the output to STDOUT in the XML format. If the > > user has added additional formats they too can be used with -f. > > What exactly is -n meant for? I don't get the right purpose here. Isn't > the DB handler defined by the DSN provided as the argument? What does > "Overrides -f" mean? Why should one provide the format 2 times? The DSN provides data about the database you are _reading_. The options are about what is written. -f specifies one of the losless formats while -n specifies a SQL format. They are separated because -n expects a class name.
> > Loading a database schema > > ------------------------- > > > > The script will have the following parameters and options: > > > > dbschemaload TARGET > > > > TARGET is the full DSN of the database to write to. > > > > -f, --format=FORMAT One of xml[default] or php. > > -t, --target-file=FILE Path to filename to read from. > > > > By default it will load the input from STDIN. If -t is used the tool will > > try to guess the format based on the file extension. The format can > > always be overriden with -f. If the user has added additional formats > > they too can be used with -f. > > I don't think that "guessing" the format is a good idea. I think the -f > option should be made mandatory. Well, it's a good guess (.xml/.php). I think it should stay. Cheers, Frederik -- Components mailing list [email protected] http://lists.ez.no/mailman/listinfo/components
