Comparison

util/sql.lua @ 6734:592f6112563e

util.sql: Expose db2uri helper function
author Matthew Wild <mwild1@gmail.com>
date Wed, 03 Jun 2015 15:55:43 +0100
parent 6733:36e2b35397b1
child 6735:b553a30620b2
comparison
equal deleted inserted replaced
6733:36e2b35397b1 6734:592f6112563e
271 self.charset = charset; 271 self.charset = charset;
272 return self:transaction(function() return self:execute(set_names_query:format(charset)); end); 272 return self:transaction(function() return self:execute(set_names_query:format(charset)); end);
273 end 273 end
274 local engine_mt = { __index = engine }; 274 local engine_mt = { __index = engine };
275 275
276 local function db2uri(params) 276 function db2uri(params)
277 return build_url{ 277 return build_url{
278 scheme = params.driver, 278 scheme = params.driver,
279 user = params.username, 279 user = params.username,
280 password = params.password, 280 password = params.password,
281 host = params.host, 281 host = params.host,