Comparison

tools/migration/migrator/prosody_sql.lua @ 8068:5abb6bc45edd

Merge 0.10->trunk
author Kim Alvefur <zash@zash.se>
date Sun, 09 Apr 2017 01:25:58 +0200
parent 8065:36d9c1226fbc
parent 8066:5eec340c75fb
child 8074:4b403f881176
comparison
equal deleted inserted replaced
8065:36d9c1226fbc 8068:5abb6bc45edd
159 assert(engine:connect()); 159 assert(engine:connect());
160 assert(engine:delete("DELETE FROM prosody")); 160 assert(engine:delete("DELETE FROM prosody"));
161 local insert_sql = "INSERT INTO `prosody` (`host`,`user`,`store`,`key`,`type`,`value`) VALUES (?,?,?,?,?,?)"; 161 local insert_sql = "INSERT INTO `prosody` (`host`,`user`,`store`,`key`,`type`,`value`) VALUES (?,?,?,?,?,?)";
162 162
163 return function(item) 163 return function(item)
164 if not item then return end -- end of input 164 if not item then assert(engine.conn:commit()) return end -- end of input
165 local host = item.host or ""; 165 local host = item.host or "";
166 local user = item.user or ""; 166 local user = item.user or "";
167 for store, data in pairs(item.stores) do 167 for store, data in pairs(item.stores) do
168 -- TODO transactions 168 -- TODO transactions
169 local extradata = {}; 169 local extradata = {};