[Dbconfig-common-devel] Re: Bug#341958: dbconfig-common: Support for table prefix

sean finney seanius at debian.org
Sun Dec 4 18:56:52 UTC 2005


hi thijs,

On Sun, Dec 04, 2005 at 02:05:01PM +0100, Thijs Kinkhorst wrote:
> I'm working on adding dbconfig-common to my package. One thing I'm
> encountering is that it allows to specify a table prefix which defaults
> to phpbb2, so your tables will be of the format phpbb2_users etc. We
> currently offer this as a debconf question on installation. In my
> perception this is a common option for webapps, right?

i could see it as a possible benefit for multiple webapps using
the same database, yes.  iirc phpgw has a similar feature.

> Is it currently possible to have dbconfig-common handle this aswell? If
> it does, I couldn't find it. If it doesn't, what are the chances of this
> being added?

unfortunately, it doesn't currently.  the problem is that
dbconfig-common as it stands is agnostic to the contents
of the databases that it creates.  that is, basically, it creates
the users/databases, and then leaves it to the maintainer-provided
sql/script to create and populate the tables.  the benefit of this
is that things are much simpler and less prone to failure/bugs.  the
drawback, obviously, is that there isn't a way to do this.

however, i am open to ideas for how this could be implmented.  here's
some thoughts off the top of my head:

at the very least, dbconfig-common could hold the common debconf
template, so that multiple packages could benefit from having the text
pre-translated.  

perhaps later dbc could be extended to handle the prompting logic so
that packages needing/wanting this could set another dbc_foo variable
in the maintscripts which would trigger the extra prompting logic,
and the result could get stored in the packages' dbc config file.
it would still be the packagers' responsibility to ensure that the table
prefixes are correctly used when creating the tables, which means that
the simple sql-file install method is out and they would have to use
the script method for installing the db, but it's an improvement,
anyway. 

btw: how is phpbb currently handling this?

i think as a final step, perhaps dbc could do something like
's/create table /create table $dbc_tbl_prefix/' on static sql
files, but this seems a little fragile to me so i'd only want
to do it after being able to do the other stuff reliably... and
even then i'd still be a little anxious about it.  


what do you think?

	sean

-- 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.alioth.debian.org/pipermail/dbconfig-common-devel/attachments/20051204/93c612ea/attachment.pgp


More information about the Dbconfig-common-devel mailing list