[ejabberd] somes Few Questions about the Sql Way to do it :)

Badlop badlop at gmail.com
Thu Apr 24 22:58:26 MSD 2008

2008/4/24, Sig <ejabberd at sighq.net>:
>  - on the tables rosterusers , where are the signification of the differents flags or where can i find it ?
>   subscription ? ask ? askmessage ? server ? subscribe ? type ?

Unfortunately, this isn't documented. You can add some contacts, and
see how they are reflected in the table.

B = both
N = none
F = from
T = to


>  - i see there is two tables : rostersusers and rostergroups , strangely the rostersgroups only have one field more
>  (grp) than rosterusers and a common keyfield,  isn't it possible to join the two tables in one ?

It seems that was the data structure of jabberd14 database. When
Alexey implemented SQL support in ejabberd, he wanted to make the
migration from jabberd14 to ejabberd easy.

Maybe the schema could be improved. That would be a good time to
abstract the database code into specific library-modules to avoid
having several ejabberd modules with similar code. For example, I
calculated that mod_roster.erl and mod_roster_odbc.erl share aprox 75%
lines of code [1].

Of course all those changes would require a considerable amount of
work and are not urgent. This rule applies: "If it works, don't touch

Are you interested in improving the database stuff?

[1] $ wc -l mod_roster.erl; wc -l mod_roster_odbc.erl; diff
mod_roster.erl mod_roster_odbc.erl -C 500 | grep "^! " | wc -l
936 mod_roster.erl
1044 mod_roster_odbc.erl

More information about the ejabberd mailing list