aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2010-11-27 19:49:29 +0000
committerMatthew Wild <mwild1@gmail.com>2010-11-27 19:49:29 +0000
commitf8114fe1b0e239d418e2f1d05952c97170efc351 (patch)
treefe7215ac6a74524efc27a85fa6bc343d4c13f010
parentffa8381db1b9bc79ac02f82faad09571f065bc2d (diff)
downloadprosody-f8114fe1b0e239d418e2f1d05952c97170efc351.tar.gz
prosody-f8114fe1b0e239d418e2f1d05952c97170efc351.zip
Rename storage/mod_ejabberd to mod_storage_sql_ejabberd. Also rename configuration option. Untested.
-rw-r--r--plugins/mod_storage_sql_ejabberd.lua (renamed from plugins/storage/mod_ejabberd.lua)13
1 files changed, 8 insertions, 5 deletions
diff --git a/plugins/storage/mod_ejabberd.lua b/plugins/mod_storage_sql_ejabberd.lua
index 17528656..74763c92 100644
--- a/plugins/storage/mod_ejabberd.lua
+++ b/plugins/mod_storage_sql_ejabberd.lua
@@ -12,16 +12,19 @@ local st = require "util.stanza";
local DBI = require "DBI";
-- connect to db
-local option_datastore_params = module:get_option("datastore_params") or error("Missing option: datastore_params");
+local params = module:get_option("sql_ejabberd") or error("No sql_ejabberd config option");
local database;
do
- local driver, db = unpack(option_datastore_params);
- module:log("debug", "Opening database: %s", "dbi:"..driver..":"..db);
+ module:log("debug", "Opening database: %s", "dbi:"..params.driver..":"..params.database);
prosody.unlock_globals();
- local dbh, err = DBI.Connect(unpack(option_datastore_params));
+ local dbh, err = DBI.Connect(
+ params.driver, params.database,
+ params.username, params.password,
+ params.host, params.port
+ );
prosody.lock_globals();
assert(dbh, err);
- dbh:autocommit(true)
+ dbh:autocommit(true);
database = dbh;
end