aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_storage_sql2.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2013-07-10 13:18:10 +0200
committerKim Alvefur <zash@zash.se>2013-07-10 13:18:10 +0200
commit127153f466392333464b986d3a7224f49ee1d899 (patch)
tree12712c30c1f20544d4bb8226ca002dd9b5980ad3 /plugins/mod_storage_sql2.lua
parente3d8ade9f0e8b2331fc65b7c8dab4282b1ce9df8 (diff)
downloadprosody-127153f466392333464b986d3a7224f49ee1d899.tar.gz
prosody-127153f466392333464b986d3a7224f49ee1d899.zip
mod_storage_sql2: Keep available store types in a table
Diffstat (limited to 'plugins/mod_storage_sql2.lua')
-rw-r--r--plugins/mod_storage_sql2.lua9
1 files changed, 7 insertions, 2 deletions
diff --git a/plugins/mod_storage_sql2.lua b/plugins/mod_storage_sql2.lua
index 0b57d48b..48da2d46 100644
--- a/plugins/mod_storage_sql2.lua
+++ b/plugins/mod_storage_sql2.lua
@@ -217,11 +217,16 @@ function keyval_store:users()
return iterator(result);
end
+local stores = {
+ keyval = keyval_store;
+};
+
local driver = {};
function driver:open(store, typ)
- if not typ then -- default key-value store
- return setmetatable({ store = store }, keyval_store);
+ local store_mt = stores[typ or "keyval"];
+ if store_mt then
+ return setmetatable({ store = store }, store_mt);
end
return nil, "unsupported-store";
end