Comparison

core/storagemanager.lua @ 13258:c8c0cfb7f5df

core.storagemanager: Remove 0.10 era sql2 driver COMPAT Unlikely that anyone has had sql2 in their configs for a long time, so this serves little purpose. Leaving the indirection function in case some similar compat code is needed in the future.
author Kim Alvefur <zash@zash.se>
date Mon, 04 Sep 2023 00:38:45 +0200
parent 12972:ead41e25ebc0
comparison
equal deleted inserted replaced
13256:53708752cc5d 13258:c8c0cfb7f5df
89 end 89 end
90 return stores_available:get(host, driver_name); 90 return stores_available:get(host, driver_name);
91 end 91 end
92 92
93 local function get_storage_config(host) 93 local function get_storage_config(host)
94 -- COMPAT w/ unreleased Prosody 0.10 and the once-experimental mod_storage_sql2 in peoples' config files 94 -- Here used to be some some compat checks
95 local storage_config = config.get(host, "storage"); 95 return config.get(host, "storage");
96 local found_sql2;
97 if storage_config == "sql2" then
98 storage_config, found_sql2 = "sql", true;
99 elseif type(storage_config) == "table" then
100 for store_name, driver_name in pairs(storage_config) do
101 if driver_name == "sql2" then
102 storage_config[store_name] = "sql";
103 found_sql2 = true;
104 end
105 end
106 end
107 if found_sql2 then
108 log("error", "The temporary 'sql2' storage module has now been renamed to 'sql', "
109 .."please update your config file: https://prosody.im/doc/modules/mod_storage_sql2");
110 end
111 return storage_config;
112 end 96 end
113 97
114 local function get_driver(host, store) 98 local function get_driver(host, store)
115 local storage = get_storage_config(host); 99 local storage = get_storage_config(host);
116 local driver_name; 100 local driver_name;