[ejabberd] [patch] use a separate non-compiled queries file for odbc

Kevin Jackson foamdino at gmail.com
Mon Apr 9 11:39:01 MSD 2007


Hi all,

We have a requirement to have a separate schema for our jabber server,
so the current odbc_queries.erl file had to be modified to meet our
needs.

I've hacked up a couple of functions that allow us to use a simple
text file to store our queries in and then read the query on the fly
from the text file, instead of having to re-compile ejabberd src when
we changes schemas.

I'm attaching the src code to the email (as I'm currently logged into
windows and don't have the src tree here so cannot svn diff :( )

I'm sure it could be improved (make the queries file name configurable
in ejabberd.cfg etc), but it works for us and I thought it would make
sense to push it to the mailing list and see if there's any value in
making this the default behaviour.

One thing to note is that the ejabberd_queries.sql file currently
contains @schema at .table etc, this is because we filter this file as
part of our build process and replace the @schema@ with whatever value
we choose.

Thanks,
Kev
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ejabberd_queries.sql
Type: application/octet-stream
Size: 2956 bytes
Desc: not available
Url : http://lists.jabber.ru/pipermail/ejabberd/attachments/20070409/1b05586a/attachment-0002.obj 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: odbc_queries.erl
Type: application/octet-stream
Size: 14930 bytes
Desc: not available
Url : http://lists.jabber.ru/pipermail/ejabberd/attachments/20070409/1b05586a/attachment-0003.obj 


More information about the ejabberd mailing list