get last run statement for debugging
Firstly, great project!
There might be a way to access this already but...
I'm trying to work out why what looks like a perfectly well formed SQLite query, which works fine in MySQL, is failing in one very specific use case.
It would be helpful if i could get a .last_query or .queries property to display the exact query which was sent, after it had been generated.
Or a way to access the same build tool that will be used to merge the query and the query values.
Thanks
Have you looked into the debug logging that databases provides? Is that sufficient?
It's also possible to print(query) or str(query) before passing to the connection.
Have you looked into the debug logging that
databasesprovides? Is that sufficient?
One very easy way to close this request would be to add a mention of this to the docs. I can't find any reference to "logging" "debug", and so on in those docs.
I got what I needed by just running
logging.getLogger("databases").setLevel(logging.DEBUG)
I need to see the compiled query too. I have tried @corydodt's code snippet but I can't see any output yet. Does anyone has any other clue about why I can't see any log output from databases in my project?