Mercurial > prosody-wiki
annotate mod_mam_sql.wiki @ 514:9427318ae72d default tip
added page for mod_delegation
author | Goffi <goffi@goffi.org> |
---|---|
date | Thu, 07 May 2015 23:31:20 +0200 |
parents | 4d4d81fa31fa |
children |
rev | line source |
---|---|
343
6cc2d1e280c9
Created wiki page through web user interface.
rdhoelz@gmail.com
parents:
diff
changeset
|
1 #summary XEP-0313: Message Archive Management using SQL |
386
46342407997c
Add Deprecated tag, no longer supported
Kim Alvefur <zash@zash.se>
parents:
352
diff
changeset
|
2 #labels Stage-Alpha, Deprecated |
343
6cc2d1e280c9
Created wiki page through web user interface.
rdhoelz@gmail.com
parents:
diff
changeset
|
3 |
500
4d4d81fa31fa
mod_mam_sql: Add warning about being unsupported and outdated
Kim Alvefur <zash@zash.se>
parents:
386
diff
changeset
|
4 *Note:* This module is unsupported and not up to date with the MAM specification |
4d4d81fa31fa
mod_mam_sql: Add warning about being unsupported and outdated
Kim Alvefur <zash@zash.se>
parents:
386
diff
changeset
|
5 |
343
6cc2d1e280c9
Created wiki page through web user interface.
rdhoelz@gmail.com
parents:
diff
changeset
|
6 = Introduction = |
6cc2d1e280c9
Created wiki page through web user interface.
rdhoelz@gmail.com
parents:
diff
changeset
|
7 |
500
4d4d81fa31fa
mod_mam_sql: Add warning about being unsupported and outdated
Kim Alvefur <zash@zash.se>
parents:
386
diff
changeset
|
8 Implementation of (an older version of) [http://xmpp.org/extensions/xep-0313.html XEP-0313: Message Archive Management] backed by a SQL database. Like [mod_mam], but using SQL. |
343
6cc2d1e280c9
Created wiki page through web user interface.
rdhoelz@gmail.com
parents:
diff
changeset
|
9 |
6cc2d1e280c9
Created wiki page through web user interface.
rdhoelz@gmail.com
parents:
diff
changeset
|
10 |
6cc2d1e280c9
Created wiki page through web user interface.
rdhoelz@gmail.com
parents:
diff
changeset
|
11 = Details = |
6cc2d1e280c9
Created wiki page through web user interface.
rdhoelz@gmail.com
parents:
diff
changeset
|
12 |
6cc2d1e280c9
Created wiki page through web user interface.
rdhoelz@gmail.com
parents:
diff
changeset
|
13 See [mod_mam] for details. |
6cc2d1e280c9
Created wiki page through web user interface.
rdhoelz@gmail.com
parents:
diff
changeset
|
14 |
6cc2d1e280c9
Created wiki page through web user interface.
rdhoelz@gmail.com
parents:
diff
changeset
|
15 = Usage = |
6cc2d1e280c9
Created wiki page through web user interface.
rdhoelz@gmail.com
parents:
diff
changeset
|
16 |
6cc2d1e280c9
Created wiki page through web user interface.
rdhoelz@gmail.com
parents:
diff
changeset
|
17 First copy the module to the prosody plugins directory. |
6cc2d1e280c9
Created wiki page through web user interface.
rdhoelz@gmail.com
parents:
diff
changeset
|
18 |
6cc2d1e280c9
Created wiki page through web user interface.
rdhoelz@gmail.com
parents:
diff
changeset
|
19 Then add "mam_sql" to your modules_enabled list: |
6cc2d1e280c9
Created wiki page through web user interface.
rdhoelz@gmail.com
parents:
diff
changeset
|
20 {{{ |
6cc2d1e280c9
Created wiki page through web user interface.
rdhoelz@gmail.com
parents:
diff
changeset
|
21 modules_enabled = { |
6cc2d1e280c9
Created wiki page through web user interface.
rdhoelz@gmail.com
parents:
diff
changeset
|
22 -- ... |
6cc2d1e280c9
Created wiki page through web user interface.
rdhoelz@gmail.com
parents:
diff
changeset
|
23 "mam_sql", |
6cc2d1e280c9
Created wiki page through web user interface.
rdhoelz@gmail.com
parents:
diff
changeset
|
24 -- ... |
6cc2d1e280c9
Created wiki page through web user interface.
rdhoelz@gmail.com
parents:
diff
changeset
|
25 } |
6cc2d1e280c9
Created wiki page through web user interface.
rdhoelz@gmail.com
parents:
diff
changeset
|
26 }}} |
6cc2d1e280c9
Created wiki page through web user interface.
rdhoelz@gmail.com
parents:
diff
changeset
|
27 |
6cc2d1e280c9
Created wiki page through web user interface.
rdhoelz@gmail.com
parents:
diff
changeset
|
28 You should probably run the SQL to create the archive table/indexes: |
6cc2d1e280c9
Created wiki page through web user interface.
rdhoelz@gmail.com
parents:
diff
changeset
|
29 |
6cc2d1e280c9
Created wiki page through web user interface.
rdhoelz@gmail.com
parents:
diff
changeset
|
30 {{{ |
6cc2d1e280c9
Created wiki page through web user interface.
rdhoelz@gmail.com
parents:
diff
changeset
|
31 CREATE TABLE `prosodyarchive` ( |
6cc2d1e280c9
Created wiki page through web user interface.
rdhoelz@gmail.com
parents:
diff
changeset
|
32 `host` TEXT, |
6cc2d1e280c9
Created wiki page through web user interface.
rdhoelz@gmail.com
parents:
diff
changeset
|
33 `user` TEXT, |
6cc2d1e280c9
Created wiki page through web user interface.
rdhoelz@gmail.com
parents:
diff
changeset
|
34 `store` TEXT, |
6cc2d1e280c9
Created wiki page through web user interface.
rdhoelz@gmail.com
parents:
diff
changeset
|
35 `id` INTEGER PRIMARY KEY AUTOINCREMENT, |
6cc2d1e280c9
Created wiki page through web user interface.
rdhoelz@gmail.com
parents:
diff
changeset
|
36 `when` INTEGER, |
6cc2d1e280c9
Created wiki page through web user interface.
rdhoelz@gmail.com
parents:
diff
changeset
|
37 `with` TEXT, |
6cc2d1e280c9
Created wiki page through web user interface.
rdhoelz@gmail.com
parents:
diff
changeset
|
38 `resource` TEXT, |
6cc2d1e280c9
Created wiki page through web user interface.
rdhoelz@gmail.com
parents:
diff
changeset
|
39 `stanza` TEXT |
6cc2d1e280c9
Created wiki page through web user interface.
rdhoelz@gmail.com
parents:
diff
changeset
|
40 ); |
6cc2d1e280c9
Created wiki page through web user interface.
rdhoelz@gmail.com
parents:
diff
changeset
|
41 CREATE INDEX `hus` ON `prosodyarchive` (`host`, `user`, `store`); |
6cc2d1e280c9
Created wiki page through web user interface.
rdhoelz@gmail.com
parents:
diff
changeset
|
42 CREATE INDEX `with` ON `prosodyarchive` (`with`); |
6cc2d1e280c9
Created wiki page through web user interface.
rdhoelz@gmail.com
parents:
diff
changeset
|
43 CREATE INDEX `thetime` ON `prosodyarchive` (`when`); |
6cc2d1e280c9
Created wiki page through web user interface.
rdhoelz@gmail.com
parents:
diff
changeset
|
44 }}} |
6cc2d1e280c9
Created wiki page through web user interface.
rdhoelz@gmail.com
parents:
diff
changeset
|
45 |
6cc2d1e280c9
Created wiki page through web user interface.
rdhoelz@gmail.com
parents:
diff
changeset
|
46 (*NOTE*: I ran the following SQL to initialize the table/indexes on MySQL): |
6cc2d1e280c9
Created wiki page through web user interface.
rdhoelz@gmail.com
parents:
diff
changeset
|
47 |
6cc2d1e280c9
Created wiki page through web user interface.
rdhoelz@gmail.com
parents:
diff
changeset
|
48 {{{ |
6cc2d1e280c9
Created wiki page through web user interface.
rdhoelz@gmail.com
parents:
diff
changeset
|
49 CREATE TABLE prosodyarchive ( |
351 | 50 `host` VARCHAR(1023) NOT NULL, |
51 `user` VARCHAR(1023) NOT NULL, | |
52 `store` VARCHAR(1023) NOT NULL, | |
343
6cc2d1e280c9
Created wiki page through web user interface.
rdhoelz@gmail.com
parents:
diff
changeset
|
53 `id` INTEGER PRIMARY KEY AUTO_INCREMENT, |
6cc2d1e280c9
Created wiki page through web user interface.
rdhoelz@gmail.com
parents:
diff
changeset
|
54 `when` INTEGER NOT NULL, |
351 | 55 `with` VARCHAR(2047) NOT NULL, |
56 `resource` VARCHAR(1023), | |
343
6cc2d1e280c9
Created wiki page through web user interface.
rdhoelz@gmail.com
parents:
diff
changeset
|
57 `stanza` TEXT NOT NULL |
6cc2d1e280c9
Created wiki page through web user interface.
rdhoelz@gmail.com
parents:
diff
changeset
|
58 ); |
6cc2d1e280c9
Created wiki page through web user interface.
rdhoelz@gmail.com
parents:
diff
changeset
|
59 CREATE INDEX hus ON prosodyarchive (host, user, store); |
6cc2d1e280c9
Created wiki page through web user interface.
rdhoelz@gmail.com
parents:
diff
changeset
|
60 CREATE INDEX `with` ON prosodyarchive (`with`); |
6cc2d1e280c9
Created wiki page through web user interface.
rdhoelz@gmail.com
parents:
diff
changeset
|
61 CREATE INDEX thetime ON prosodyarchive (`when`); |
6cc2d1e280c9
Created wiki page through web user interface.
rdhoelz@gmail.com
parents:
diff
changeset
|
62 }}} |
6cc2d1e280c9
Created wiki page through web user interface.
rdhoelz@gmail.com
parents:
diff
changeset
|
63 |
6cc2d1e280c9
Created wiki page through web user interface.
rdhoelz@gmail.com
parents:
diff
changeset
|
64 You may want to tweak the column sizes a bit; I did for my own purposes. |
6cc2d1e280c9
Created wiki page through web user interface.
rdhoelz@gmail.com
parents:
diff
changeset
|
65 |
6cc2d1e280c9
Created wiki page through web user interface.
rdhoelz@gmail.com
parents:
diff
changeset
|
66 = Configuration = |
6cc2d1e280c9
Created wiki page through web user interface.
rdhoelz@gmail.com
parents:
diff
changeset
|
67 |
6cc2d1e280c9
Created wiki page through web user interface.
rdhoelz@gmail.com
parents:
diff
changeset
|
68 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. |
6cc2d1e280c9
Created wiki page through web user interface.
rdhoelz@gmail.com
parents:
diff
changeset
|
69 |
6cc2d1e280c9
Created wiki page through web user interface.
rdhoelz@gmail.com
parents:
diff
changeset
|
70 = Compatibility = |
6cc2d1e280c9
Created wiki page through web user interface.
rdhoelz@gmail.com
parents:
diff
changeset
|
71 || 0.8 || ? || |
6cc2d1e280c9
Created wiki page through web user interface.
rdhoelz@gmail.com
parents:
diff
changeset
|
72 || 0.9 || Works || |
351 | 73 || trunk || Works || |