Comparison

plugins/mod_storage_sql2.lua @ 5776:bd0ff8ae98a8

Remove all trailing whitespace
author Florian Zeitz <florob@babelmonkeys.de>
date Fri, 09 Aug 2013 17:48:21 +0200
parent 5765:d854c17a45fd
child 5847:6aaa7ad4463c
comparison
equal deleted inserted replaced
5775:a6c2b8933507 5776:bd0ff8ae98a8
135 end 135 end
136 end 136 end
137 137
138 do -- process options to get a db connection 138 do -- process options to get a db connection
139 params = params or { driver = "SQLite3" }; 139 params = params or { driver = "SQLite3" };
140 140
141 if params.driver == "SQLite3" then 141 if params.driver == "SQLite3" then
142 params.database = resolve_relative_path(prosody.paths.data or ".", params.database or "prosody.sqlite"); 142 params.database = resolve_relative_path(prosody.paths.data or ".", params.database or "prosody.sqlite");
143 end 143 end
144 144
145 assert(params.driver and params.database, "Both the SQL driver and the database need to be specified"); 145 assert(params.driver and params.database, "Both the SQL driver and the database need to be specified");
146 146
147 --local dburi = db2uri(params); 147 --local dburi = db2uri(params);
148 engine = mod_sql:create_engine(params); 148 engine = mod_sql:create_engine(params);
149 149
150 -- Encoding mess 150 -- Encoding mess
151 set_encoding(); 151 set_encoding();
152 152
153 -- Automatically create table, ignore failure (table probably already exists) 153 -- Automatically create table, ignore failure (table probably already exists)
154 create_table(); 154 create_table();
202 return result; 202 return result;
203 end 203 end
204 end 204 end
205 local function keyval_store_set(data) 205 local function keyval_store_set(data)
206 engine:delete("DELETE FROM `prosody` WHERE `host`=? AND `user`=? AND `store`=?", host, user or "", store); 206 engine:delete("DELETE FROM `prosody` WHERE `host`=? AND `user`=? AND `store`=?", host, user or "", store);
207 207
208 if data and next(data) ~= nil then 208 if data and next(data) ~= nil then
209 local extradata = {}; 209 local extradata = {};
210 for key, value in pairs(data) do 210 for key, value in pairs(data) do
211 if type(key) == "string" and key ~= "" then 211 if type(key) == "string" and key ~= "" then
212 local t, value = serialize(value); 212 local t, value = serialize(value);