[Dbconfig-common-devel] SQLite Support

Matt Brown debian at mattb.net.nz
Sun Jun 11 03:55:13 UTC 2006


Hi All,

I think the SQLite support is ready to roll, or at least have some wider
testing. Using the 'sqlite' database type you can setup/upgrade and
purge sqlite databases that are created on the local filesystem. By
default these databases will be named after the package calling
dbconfig-common and placed in /var/lib/dbconfig-common, however this can
be easily overridden by setting the dbc_basepath, dbc_dbname hints in
your config script. Permissions and ownership for the created database
are controlled similarly via dbc_owner and dbc_mode. There are also low
priority debconf questions for these new options. Owner defaults to
root:root permissions to 0644. This seems sane to me, but I'm open to
comments.

The primary changes I had to make to the rest of the dbconfig-common
infrastructure were to avoid asking questions about username/password
authentication and host/port details, which sqlite obviously doesn't
support. The approach I've take to this is to create lists of "features"
supported by each database type in dpkg/common, eg:

	# database types supporting authenticated access
	dbc_authenticated_dbtypes="mysql pgsql"

	# database types supporting remote access
	dbc_remote_dbtypes="mysql pgsql"

	# database types storing files on the filesystem
	dbc_fs_dbtypes="sqlite"

It's then a simple check before doing anything relating to the feature
to see whether the current dbtype is in the list.

There is a new example package to test sqlite support and I've updated
the documentation to reflect the new basetype, owner and mode options.
I've also extended -generate-include and -load-include to write/read the
basetype option. It would be relatively trivial to have
-generate-include write out something like dbc_filename which would
consist of "${dbc_basepath}/${dbc_dbname}" to save applications doing it
themselves if you though it was worthwhile...?

I've updated the branch to match the current state of the trunk, so
there are no merge conflicts. The diff weighs in at:

svn diff trunk /branches/sqlite | diffstat
44 files changed, 2512 insertions(+), 705 deletions(-)

However, much of that is po file updates thanks to the new templates:

svn diff trunk/debian/po branches/sqlite/debian/po | diffstat
14 files changed, 1427 insertions(+), 574 deletions(-)

A fair bit is also the addition of the example package so hopefully the
meaty changes are fairly straightforward and obvious.

Adding support for sqlite3 is probably relatively trivial as well. I
think it can probably be made to use internal/sqlite and just call the
sqlite3 binary instead of sqlite when necessary. I'd like to get sqlite
support into the archive before tackling that so that I can start
migrating phpwiki onto using dbconfig-common.

Let me know what you think.

Cheers

-- 
Matt Brown
matt at mattb.net.nz
Mob +64 21 611 544 www.mattb.net.nz

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 191 bytes
Desc: OpenPGP digital signature
Url : http://lists.alioth.debian.org/pipermail/dbconfig-common-devel/attachments/20060611/c1e4e262/signature.pgp


More information about the Dbconfig-common-devel mailing list