Feature request: Add mogrify to Cursor
The reasoning behind this change was already covered in PyMySQL: https://github.com/PyMySQL/PyMySQL/pull/330
I was wondering if there was any chance that this change would be considered for mysqlclient? I didn't see it mentioned in any of the previous issues. Having this consistent interface between PyMySQL and mysqlclient would make it simpler to support both projects.
Thank you for your time!
I have what I believe to be an initial working version of this. I need to expand the testing, but I'll hold off until I get a sense for whether this would be considered as a feature or not.
It makes sense. Compatibility between mysqlclient and PyMySQL (except low level APIs provided by MySQLdb._mysql module) is welcome.
FWI, PyMySQL and mysqlclient provides Cursor._executed attribute.
I think this can be a public API (e.g. Cursor.last_executed_query) and both mysqlclient and PyMySQL implemented it.
Thank you for the feedback, @methane. I was also thinking about exposing _executed as part of the public API. I think that having both could be useful depending on whether the query is needed before or after it is executed. The Cursor.last_executed_query change seems trivial at the surface, so I can probably get a PR together for that too.