Date: 2009-10-25 03:14
Sender: Mike Pomraning
dbi-0.4.2 (2009-07-11) introduced DBI::DatabaseHandle#last_statement,
which is the SQL most recently #prepare()d, #execute()d or #do()ne
on the handle.
However, it seems to me that the intent of this request is best
served by additionally having any sth.execute() update the
last_statement attribute of its parent dbh. E.g.,
class DBI::StatementHandle
def execute(*bindvars)
self.dbh.instance_variable_set(:@last_statement, @query)
...
end
end
Note that StatementHandles right now (0.4.3) do not record the
queries they are asked to execute.
Reactions? |