webmcp
view framework/env/trace/sql.lua @ 54:89030e955845
Changed partialload_encodeFormData(...) to allow non-string objects implementing .toString()
author | jbe |
---|---|
date | Tue Sep 06 21:05:11 2011 +0200 (2011-09-06) |
parents | 0bbfee4d4aed |
children | 1fbdccf4f8e9 |
line source
1 --[[--
2 trace.sql{
3 command = command, -- executed SQL command as string
4 error_position = error_position -- optional position in bytes where an error occurred
5 }
7 This command can be used to log SQL command execution. It is currently not invoked automatically.
9 --]]--
11 -- TODO: automatic use of this function?
13 function trace.sql(args)
14 if not trace._disabled then
15 local command = args.command
16 local error_position = args.error_position
17 if type(command) ~= "string" then
18 error("No command string passed to trace.sql{...}.")
19 end
20 if error_position and type(error_position) ~= "number" then
21 error("error_position must be a number.")
22 end
23 trace._new_entry{
24 type = "sql",
25 command = command,
26 error_position = error_position
27 }
28 end
29 end