comparison mod_mam_sql.wiki @ 343:6cc2d1e280c9

Created wiki page through web user interface.
author rdhoelz@gmail.com
date Thu, 25 Apr 2013 09:50:58 +0000
parents
children 817e175c37df
comparison
equal deleted inserted replaced
342:8e758f27b460 343:6cc2d1e280c9
1 #summary XEP-0313: Message Archive Management using SQL
2
3 = Introduction =
4
5 Implementation of [http://xmpp.org/extensions/xep-0313.html XEP-0313: Message Archive Management] backed by a SQL database. Like [mod_mam], but using SQL.
6
7
8 = Details =
9
10 See [mod_mam] for details.
11
12 = Usage =
13
14 First copy the module to the prosody plugins directory.
15
16 Then add "mam_sql" to your modules_enabled list:
17 {{{
18 modules_enabled = {
19 -- ...
20 "mam_sql",
21 -- ...
22 }
23 }}}
24
25 You should probably run the SQL to create the archive table/indexes:
26
27 {{{
28 CREATE TABLE `prosodyarchive` (
29 `host` TEXT,
30 `user` TEXT,
31 `store` TEXT,
32 `id` INTEGER PRIMARY KEY AUTOINCREMENT,
33 `when` INTEGER,
34 `with` TEXT,
35 `resource` TEXT,
36 `stanza` TEXT
37 );
38 CREATE INDEX `hus` ON `prosodyarchive` (`host`, `user`, `store`);
39 CREATE INDEX `with` ON `prosodyarchive` (`with`);
40 CREATE INDEX `thetime` ON `prosodyarchive` (`when`);
41 }}}
42
43 (*NOTE*: I ran the following SQL to initialize the table/indexes on MySQL):
44
45 {{{
46 CREATE TABLE prosodyarchive (
47 `host` VARCHAR(16) NOT NULL,
48 `user` VARCHAR(16) NOT NULL,
49 `store` CHAR(8) NOT NULL,
50 `id` INTEGER PRIMARY KEY AUTO_INCREMENT,
51 `when` INTEGER NOT NULL,
52 `with` VARCHAR(32) NOT NULL,
53 `resource` VARCHAR(16) NOT NULL,
54 `stanza` TEXT NOT NULL
55 );
56 CREATE INDEX hus ON prosodyarchive (host, user, store);
57 CREATE INDEX `with` ON prosodyarchive (`with`);
58 CREATE INDEX thetime ON prosodyarchive (`when`);
59 }}}
60
61 You may want to tweak the column sizes a bit; I did for my own purposes.
62
63 = Configuration =
64
65 This module uses the same configuration settings that [mod_mam] does, in addition to the [http://prosody.im/doc/modules/mod_storage_sql SQL storage settings]. You may also name the SQL connection settings 'mam_sql' if you want.
66
67 = Compatibility =
68 || 0.8 || ? ||
69 || 0.9 || Works ||
70 || trunk || Works ||