Comparison

plugins/mod_storage_sql.lua @ 3853:1a58bbe19c60

mod_storage_sql: Default value for option sql = { driver = "SQLite3", database = "prosody.sqlite" }.
author Waqas Hussain <waqas20@gmail.com>
date Sun, 12 Dec 2010 05:38:48 +0500
parent 3852:ab8d1c90527c
child 3732:bf449ecf2144
comparison
equal deleted inserted replaced
3852:ab8d1c90527c 3853:1a58bbe19c60
31 local host,user,store = module.host; 31 local host,user,store = module.host;
32 32
33 do -- process options to get a db connection 33 do -- process options to get a db connection
34 local DBI = require "DBI"; 34 local DBI = require "DBI";
35 35
36 local params = module:get_option("sql"); 36 local params = module:get_option("sql") or { driver = "SQLite3", database = "prosody.sqlite" };
37 assert(params and params.driver and params.database, "invalid params"); 37 assert(params and params.driver and params.database, "invalid params");
38 38
39 prosody.unlock_globals(); 39 prosody.unlock_globals();
40 local dbh, err = DBI.Connect( 40 local dbh, err = DBI.Connect(
41 params.driver, params.database, 41 params.driver, params.database,