aboutsummaryrefslogtreecommitdiffstats
path: root/tools/migration/migrator/prosody_sql.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2017-02-04 01:08:27 +0100
committerKim Alvefur <zash@zash.se>2017-02-04 01:08:27 +0100
commit314ce335b9a3f23224237f829c9b166eeb345187 (patch)
tree300927642fc0f857d9ea96ab4b1e2bc2d4c20950 /tools/migration/migrator/prosody_sql.lua
parentc534c1414eec471209c54a917152593da3198c90 (diff)
parent0f6de0b8f9c41090298ca0b3f998832971ff51b2 (diff)
downloadprosody-314ce335b9a3f23224237f829c9b166eeb345187.tar.gz
prosody-314ce335b9a3f23224237f829c9b166eeb345187.zip
Merge 0.10->trunk
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 1872a85d..b8876af0 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 https://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;
+}