From 127153f466392333464b986d3a7224f49ee1d899 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Wed, 10 Jul 2013 13:18:10 +0200 Subject: mod_storage_sql2: Keep available store types in a table --- plugins/mod_storage_sql2.lua | 9 +++++++-- 1 file 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 -- cgit v1.2.3