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
commit1e1834a4ec05554473438f43f44c34e2809a330f (patch)
tree12712c30c1f20544d4bb8226ca002dd9b5980ad3 /plugins/mod_storage_sql2.lua
parent06561ae51323ea7e8e2939aa3fc7ac854f3b51ff (diff)
downloadprosody-1e1834a4ec05554473438f43f44c34e2809a330f.tar.gz
prosody-1e1834a4ec05554473438f43f44c34e2809a330f.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