[Kamailio-Devel] RFC: database interface module infrastructure

Henning Westerholt henning.westerholt at 1und1.de
Mon Aug 11 13:08:41 CEST 2008


Hi all,

during the refactoring of the DB API for the 1.4 release i touched a lot
of module code. Every module that needs to connect to a DB has more or
less the same needs:

- init, connect, close the connection
- do some versions checks
- define some variables for e.g. column names and access handles
- update string length for this configuration parameter in mod_init

I already pushed some of this tasks like the version handling into the
core, to unify the module behaviour, reduce code duplication and improve
maintainability and flexibility.

As this DB infrastructure stuff is not exactly the most interesting thing
in the world to care about i just wondered if it makes sense to auto
generate parts of it from the table XML source in db/schema. I started
some evaluation a few weeks ago, and created some initial implementation.
I converted the auth_db module to use this code, and did some initial
tests.


But before i go further in this direction i want to ask if you think that
going this way makes sense. I've attached my proposal for autogenerated DB
functions for the auth_db module for your review.

Please let me know now your opinion,

Henning
-------------- next part --------------
A non-text attachment was scrubbed...
Name: db_auth_db.h
Type: text/x-chdr
Size: 3750 bytes
Desc: not available
Url : http://lists.kamailio.org/pipermail/devel/attachments/20080811/fd090c52/attachment.h 


More information about the Devel mailing list