# HG changeset patch # User Kim Alvefur # Date 1686407988 -7200 # Node ID 033ea8b46d6a1bbe990c643ca3bc8ccf24a4a782 # Parent 3ec48555b773ef38d23042fa527ac21d9fabe511 mod_storage_sql: Compose a keyval+ store out of keyval and map store methods Removes the need for the shim in storagemanager. The methods only really access the 'store' property of the first (self) argument, so this is safe. diff -r 3ec48555b773 -r 033ea8b46d6a plugins/mod_storage_sql.lua --- a/plugins/mod_storage_sql.lua Sat Jun 10 15:44:09 2023 +0200 +++ b/plugins/mod_storage_sql.lua Sat Jun 10 16:39:48 2023 +0200 @@ -660,10 +660,27 @@ return iterator(result); end +local keyvalplus = { + __index = { + -- keyval + get = keyval_store.get; + set = keyval_store.set; + items = keyval_store.users; + -- map + get_key = map_store.get; + set_key = map_store.set; + remove = map_store.remove; + set_keys = map_store.set_keys; + get_key_from_all = map_store.get_all; + delete_key_from_all = map_store.delete_all; + }; +} + local stores = { keyval = keyval_store; map = map_store; archive = archive_store; + ["keyval+"] = keyvalplus; }; --- Implement storage driver API