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
commite902bcea2ee39bf7fdeda44d9f28dd8c893084d7 (patch)
tree300927642fc0f857d9ea96ab4b1e2bc2d4c20950 /tools/migration/migrator/prosody_sql.lua
parentf01dafc6febdb8e36bfe475853f8e1d4b6ccf8cd (diff)
parent0e99534951484e5c1ab98897272c92ea6b13f8ff (diff)
downloadprosody-e902bcea2ee39bf7fdeda44d9f28dd8c893084d7.tar.gz
prosody-e902bcea2ee39bf7fdeda44d9f28dd8c893084d7.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;
+}