aboutsummaryrefslogtreecommitdiffstats
path: root/tools/migration/migrator/prosody_sql.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2017-02-02 20:49:09 +0100
committerKim Alvefur <zash@zash.se>2017-02-02 20:49:09 +0100
commit04c82ce1bc86ace025c55e7f7a63044edfc237df (patch)
tree5112717a057722f10d70b13097004eb77572fe54 /tools/migration/migrator/prosody_sql.lua
parent429bf04ce448523a3f4bad4a3c60afd420a69cdf (diff)
downloadprosody-04c82ce1bc86ace025c55e7f7a63044edfc237df.tar.gz
prosody-04c82ce1bc86ace025c55e7f7a63044edfc237df.zip
tools/migration/migrator/*: Remove use of module()
Diffstat (limited to 'tools/migration/migrator/prosody_sql.lua')
-rw-r--r--tools/migration/migrator/prosody_sql.lua10
1 files changed, 6 insertions, 4 deletions
diff --git a/tools/migration/migrator/prosody_sql.lua b/tools/migration/migrator/prosody_sql.lua
index 180ae910..0041ca9e 100644
--- a/tools/migration/migrator/prosody_sql.lua
+++ b/tools/migration/migrator/prosody_sql.lua
@@ -15,7 +15,6 @@ if not have_DBI then
error("LuaDBI (required for SQL support) was not found, please see http://prosody.im/doc/depends#luadbi", 0);
end
-module "prosody_sql"
local function create_table(connection, params)
local create_sql = "CREATE TABLE `prosody` (`host` TEXT, `user` TEXT, `store` TEXT, `key` TEXT, `type` TEXT, `value` TEXT);";
@@ -110,7 +109,7 @@ local function decode_user(item)
return userdata;
end
-function reader(input)
+local function reader(input)
local dbh = assert(DBI.Connect(
assert(input.driver, "no input.driver specified"),
assert(input.database, "no input.database specified"),
@@ -154,7 +153,7 @@ function reader(input)
end;
end
-function writer(output, iter)
+local function writer(output, iter)
local dbh = assert(DBI.Connect(
assert(output.driver, "no output.driver specified"),
assert(output.database, "no output.database specified"),
@@ -197,4 +196,7 @@ function writer(output, iter)
end
-return _M;
+return {
+ reader = reader;
+ writer = writer;
+}