From: <pdu...@so...> - 2004-05-11 15:47:27
|
Hi Boris, > I include your script to the next release. Perhaps with some minor > modifications. Maybe we should test if a table exists already instead of the > filetest. No problem, you can modify it. Maybe it will be a good idea to also modify pkit_setup_sqlite_dbfile.pl, so that it calls pkit_setup_db.pl, in order to minimize code, errors and maintenance. Here is what happens when you already have the tables in the db: $ ~/dev/pagekitÅpache-PageKit/scripts/pkit_setup_db.pl Pg pagekit pageuser xxx DBD::Pg::db do failed: ERROR: relation "pkit_user"already exists at /home/pdupreez/dev/pagekitÅpache-PageKit/scripts/pkit_setup_db.pl line 56. ERROR: relation "pkit_user"already exists at /home/pdupreez/dev/pagekitÅpache-PageKit/scripts/pkit_setup_db.pl line 56. It's cluttered, but clear to me. On the other hand it might be worth to wive a better output (or even success) to a new-be. One possible trap will be, if the table is owned by another user. It already happened to me, as I created the tables by hand. The problem appears later, when the application can't access the tables, even though they are there. The ultimate solution will be something like this: - Tell the user which db drivers he has installed (see pkit_setup_db.pl for an example) - Force the user to first setup their Config/Config.xml A harsh part in the README, or even a curses script might do. - Add the following variables to Config/Config.xml (maybe in a separate section, like 'database'): - DBD (database driver) - Database name - Database user (not needed if db is set up for httpd user) - Database pwd ( ditto ) - Write a pkit_setup.pl that reads Config/Config.xml in order to: - Do a sanity check on Config/Config.xml. This will reduce some first-run-time frustration (and stupid mistakes). - Check and populate the db. > Thanks a lot! No problem! cu -- Pieter |