comparison plugins/mod_storage_sql.lua @ 6285:ea60d0441df7

Merge 0.10->trunk
author Kim Alvefur <zash@zash.se>
date Sat, 21 Jun 2014 15:05:52 +0200
parents 7cf6d3a2c855
children 99de8f30d99e
comparison
equal deleted inserted replaced
6278:fcc3ef191293 6285:ea60d0441df7
378 end 378 end
379 379
380 local driver = {}; 380 local driver = {};
381 381
382 function driver:open(store, typ) 382 function driver:open(store, typ)
383 if not typ then -- default key-value store 383 if typ and typ ~= "keyval" then
384 return setmetatable({ store = store }, keyval_store); 384 return nil, "unsupported-store";
385 end 385 end
386 return nil, "unsupported-store"; 386 return setmetatable({ store = store }, keyval_store);
387 end 387 end
388 388
389 function driver:stores(username) 389 function driver:stores(username)
390 local sql = "SELECT DISTINCT `store` FROM `prosody` WHERE `host`=? AND `user`" .. 390 local sql = "SELECT DISTINCT `store` FROM `prosody` WHERE `host`=? AND `user`" ..
391 (username == true and "!=?" or "=?"); 391 (username == true and "!=?" or "=?");