Comparison

plugins/mod_storage_sql.lua @ 12977:74b9e05af71e

plugins: Prefix module imports with prosody namespace
author Kim Alvefur <zash@zash.se>
date Fri, 24 Mar 2023 13:15:28 +0100
parent 12875:a28f77018476
child 13143:3ec48555b773
comparison
equal deleted inserted replaced
12976:a187600ec7d6 12977:74b9e05af71e
1 1
2 -- luacheck: ignore 212/self 2 -- luacheck: ignore 212/self
3 3
4 local deps = require "util.dependencies"; 4 local deps = require "prosody.util.dependencies";
5 local cache = require "util.cache"; 5 local cache = require "prosody.util.cache";
6 local json = require "util.json"; 6 local json = require "prosody.util.json";
7 local sqlite = deps.softreq "util.sqlite3"; 7 local sqlite = deps.softreq "prosody.util.sqlite3";
8 local dbisql = (sqlite and deps.softreq or require) "util.sql"; 8 local dbisql = (sqlite and deps.softreq or require) "prosody.util.sql";
9 local xml_parse = require "util.xml".parse; 9 local xml_parse = require "prosody.util.xml".parse;
10 local uuid = require "util.uuid"; 10 local uuid = require "prosody.util.uuid";
11 local resolve_relative_path = require "util.paths".resolve_relative_path; 11 local resolve_relative_path = require "prosody.util.paths".resolve_relative_path;
12 local jid_join = require "util.jid".join; 12 local jid_join = require "prosody.util.jid".join;
13 13
14 local is_stanza = require"util.stanza".is_stanza; 14 local is_stanza = require"prosody.util.stanza".is_stanza;
15 local t_concat = table.concat; 15 local t_concat = table.concat;
16 16
17 local noop = function() end 17 local noop = function() end
18 local unpack = table.unpack; 18 local unpack = table.unpack;
19 local function iterator(result) 19 local function iterator(result)
869 869
870 module:provides("storage", driver); 870 module:provides("storage", driver);
871 end 871 end
872 872
873 function module.command(arg) 873 function module.command(arg)
874 local config = require "core.configmanager"; 874 local config = require "prosody.core.configmanager";
875 local hi = require "util.human.io"; 875 local hi = require "prosody.util.human.io";
876 local command = table.remove(arg, 1); 876 local command = table.remove(arg, 1);
877 if command == "upgrade" then 877 if command == "upgrade" then
878 -- We need to find every unique dburi in the config 878 -- We need to find every unique dburi in the config
879 local uris = {}; 879 local uris = {};
880 for host in pairs(prosody.hosts) do -- luacheck: ignore 431/host 880 for host in pairs(prosody.hosts) do -- luacheck: ignore 431/host