webmcp
annotate framework/env/trace/sql.lua @ 58:e2b8f9dcc4a6
Bug fix in ui.form related to file upload
| author | bsw | 
|---|---|
| date | Sun Dec 18 22:19:40 2011 +0100 (2011-12-18) | 
| parents | 0bbfee4d4aed | 
| children | 1fbdccf4f8e9 | 
| rev | line source | 
|---|---|
| jbe/bsw@0 | 1 --[[-- | 
| jbe/bsw@0 | 2 trace.sql{ | 
| jbe/bsw@0 | 3 command = command, -- executed SQL command as string | 
| jbe/bsw@0 | 4 error_position = error_position -- optional position in bytes where an error occurred | 
| jbe/bsw@0 | 5 } | 
| jbe/bsw@0 | 6 | 
| jbe/bsw@0 | 7 This command can be used to log SQL command execution. It is currently not invoked automatically. | 
| jbe/bsw@0 | 8 | 
| jbe/bsw@0 | 9 --]]-- | 
| jbe/bsw@0 | 10 | 
| jbe/bsw@0 | 11 -- TODO: automatic use of this function? | 
| jbe/bsw@0 | 12 | 
| jbe/bsw@0 | 13 function trace.sql(args) | 
| jbe@41 | 14 if not trace._disabled then | 
| jbe@41 | 15 local command = args.command | 
| jbe@41 | 16 local error_position = args.error_position | 
| jbe@41 | 17 if type(command) ~= "string" then | 
| jbe@41 | 18 error("No command string passed to trace.sql{...}.") | 
| jbe@41 | 19 end | 
| jbe@41 | 20 if error_position and type(error_position) ~= "number" then | 
| jbe@41 | 21 error("error_position must be a number.") | 
| jbe@41 | 22 end | 
| jbe@41 | 23 trace._new_entry{ | 
| jbe@41 | 24 type = "sql", | 
| jbe@41 | 25 command = command, | 
| jbe@41 | 26 error_position = error_position | 
| jbe@41 | 27 } | 
| jbe/bsw@0 | 28 end | 
| jbe/bsw@0 | 29 end |