From cf877e5b4fbb8d99edd800a768b4902b47cbf6d3 Mon Sep 17 00:00:00 2001 From: Ted Trask Date: Thu, 31 Oct 2013 13:34:21 +0000 Subject: Reorganize code slightly so runsqlcommand is defined before use --- provisioning-model.lua | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/provisioning-model.lua b/provisioning-model.lua index c45cdb7..0408dc9 100644 --- a/provisioning-model.lua +++ b/provisioning-model.lua @@ -34,6 +34,19 @@ local functions -- ################################################################################ -- LOCAL FUNCTIONS + +-- This function is used by scripts, do not change prototype +local runsqlcommand = function(sql, transaction) + mymodule.logevent(sql) + return provdb.runsqlcommand(sql, transaction) +end + +-- This function is used by scripts, do not change prototype +local getselectresponse = function(sql, transaction) + mymodule.logevent(sql) + return provdb.getselectresponse(sql, transaction) +end + local function assert (v, m) if not v then m = m or "Assertion failed!" @@ -114,18 +127,6 @@ local databaseconnect = function() return result end --- This function is used by scripts, do not change prototype -local runsqlcommand = function(sql, transaction) - mymodule.logevent(sql) - return provdb.runsqlcommand(sql, transaction) -end - --- This function is used by scripts, do not change prototype -local getselectresponse = function(sql, transaction) - mymodule.logevent(sql) - return provdb.getselectresponse(sql, transaction) -end - local validateparam validateparam = function(p, allowdefault) if p.type == "group" then -- cgit v1.2.3