# HG changeset patch # User Kim Alvefur # Date 1373455090 -7200 # Node ID 49f1fed6e25eb4c5c135c8b4b877ac32ce66b859 # Parent aeeced7b0149c83a158e0142c09a798d62629806 mod_storage_sql2: Keep available store types in a table diff -r aeeced7b0149 -r 49f1fed6e25e plugins/mod_storage_sql2.lua --- a/plugins/mod_storage_sql2.lua Wed Jul 10 12:08:44 2013 +0200 +++ b/plugins/mod_storage_sql2.lua Wed Jul 10 13:18:10 2013 +0200 @@ -217,11 +217,16 @@ 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