#341958 dbconfig-common: Support for table prefix

#341958#5
Date:
2005-12-04 13:05:01 UTC
From:
To:
Hello Sean,

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?

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?

thanks,
Thijs

#341958#10
Date:
2005-12-04 18:56:52 UTC
From:
To:
hi thijs,

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

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

#341958#15
Date:
2005-12-31 12:24:53 UTC
From:
To:
I guess that would create confusion if dbconfig-common doesn't also
provide functionality to use the prefix.

This would be a good start. It would at least make it possible for those
packages that really want it, even if it's not very easy.

On further invesitgation, it doesn't. I thought it did, but I
appearently confused it being on the todo-list with actually doing it.
So that's good news in the sense that converting to dbconfig-common will
not be a regression for us. I hope to fix this sometime soon but it
keeps being pushed back due to other packaging considerations.


bye,
Thijs