Diff

tools/migration/migrator/prosody_sql.lua @ 7885:236b5a6154b2

Merge 0.10->trunk
author Kim Alvefur <zash@zash.se>
date Sat, 04 Feb 2017 01:08:27 +0100
parent 7359:a5a080c12c96
parent 7881:4e3067272fae
child 8065:36d9c1226fbc
line wrap: on
line diff
--- a/tools/migration/migrator/prosody_sql.lua	Sun Jan 29 22:32:03 2017 +0100
+++ b/tools/migration/migrator/prosody_sql.lua	Sat Feb 04 01:08:27 2017 +0100
@@ -15,7 +15,6 @@
 	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 @@
 	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 @@
 	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 @@
 end
 
 
-return _M;
+return {
+	reader = reader;
+	writer = writer;
+}