webmcp
diff libraries/mondelefant/mondelefant.lua @ 421:c343ce9092ee
Added downward-compatibility code for mondelefant.connect{engine='postgresql', ...} call
author | jbe |
---|---|
date | Tue Jan 12 18:57:17 2016 +0100 (2016-01-12) |
parents | 4bcedf32b089 |
children | b4aac2bdc33d |
line diff
1.1 --- a/libraries/mondelefant/mondelefant.lua Tue Jan 12 18:39:32 2016 +0100 1.2 +++ b/libraries/mondelefant/mondelefant.lua Tue Jan 12 18:57:17 2016 +0100 1.3 @@ -38,6 +38,24 @@ 1.4 setfenv(1, _M) 1.5 end 1.6 1.7 +-- TODO: remove following downward-compatibility code 1.8 +-- for mondelefant.connect{...} function: 1.9 + 1.10 +do 1.11 + local original_connect_function = connect 1.12 + function connect(args) 1.13 + if args.engine == "postgresql" then 1.14 + local newargs = {} 1.15 + for k, v in pairs(args) do 1.16 + if k ~= "engine" then newargs[k] = v end 1.17 + end 1.18 + return original_connect_function(newargs) 1.19 + else 1.20 + return original_connect_function(args) 1.21 + end 1.22 + end 1.23 +end 1.24 + 1.25 1.26 1.27 ---------------