Software /
code /
prosody
Diff
tools/migration/migrator/prosody_sql.lua @ 7881:4e3067272fae
tools/migration/migrator/*: Remove use of module()
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Thu, 02 Feb 2017 20:49:09 +0100 |
parent | 5776:bd0ff8ae98a8 |
child | 7885:236b5a6154b2 |
child | 8063:605fa6bfafd1 |
line wrap: on
line diff
--- a/tools/migration/migrator/prosody_sql.lua Thu Feb 02 20:11:25 2017 +0100 +++ b/tools/migration/migrator/prosody_sql.lua Thu Feb 02 20:49:09 2017 +0100 @@ -15,7 +15,6 @@ 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 @@ 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; +}