jbe/bsw@0: --[[-- jbe/bsw@0: trace.sql{ jbe/bsw@0: command = command, -- executed SQL command as string jbe/bsw@0: error_position = error_position -- optional position in bytes where an error occurred jbe/bsw@0: } jbe/bsw@0: jbe/bsw@0: This command can be used to log SQL command execution. It is currently not invoked automatically. jbe/bsw@0: jbe/bsw@0: --]]-- jbe/bsw@0: jbe/bsw@0: -- TODO: automatic use of this function? jbe/bsw@0: jbe/bsw@0: function trace.sql(args) jbe/bsw@0: local command = args.command jbe/bsw@0: local error_position = args.error_position jbe/bsw@0: if type(command) ~= "string" then jbe/bsw@0: error("No command string passed to trace.sql{...}.") jbe/bsw@0: end jbe/bsw@0: if error_position and type(error_position) ~= "number" then jbe/bsw@0: error("error_position must be a number.") jbe/bsw@0: end jbe/bsw@0: trace._new_entry{ jbe/bsw@0: type = "sql", jbe/bsw@0: command = command, jbe/bsw@0: error_position = error_position jbe/bsw@0: } jbe/bsw@0: end