added new function to return the last sql query run

Hi,
I have added a function in the library to return the last sql query run. I find it useful for debugging purpose. 
Thank you.