Diff

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
line wrap: on
line diff
--- a/plugins/mod_storage_sql.lua	Sun Dec 12 05:38:08 2010 +0500
+++ b/plugins/mod_storage_sql.lua	Sun Dec 12 05:38:48 2010 +0500
@@ -33,7 +33,7 @@
 do -- process options to get a db connection
 	local DBI = require "DBI";
 
-	local params = module:get_option("sql");
+	local params = module:get_option("sql") or { driver = "SQLite3", database = "prosody.sqlite" };
 	assert(params and params.driver and params.database, "invalid params");
 	
 	prosody.unlock_globals();