You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The reasoning behind this change was already covered in PyMySQL: PyMySQL/PyMySQL#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.
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.
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.
Activity
[-]Add mogrify to Cursor[/-][+]Feature request: Add mogrify to Cursor[/+]steveteahan commentedon Jan 16, 2021
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.
methane commentedon Jan 18, 2021
It makes sense. Compatibility between mysqlclient and PyMySQL (except low level APIs provided by
MySQLdb._mysqlmodule) is welcome.methane commentedon Jan 18, 2021
FWI, PyMySQL and mysqlclient provides
Cursor._executedattribute.I think this can be a public API (e.g.
Cursor.last_executed_query) and both mysqlclient and PyMySQL implemented it.steveteahan commentedon Jan 18, 2021
Thank you for the feedback, @methane. I was also thinking about exposing
_executedas 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. TheCursor.last_executed_querychange seems trivial at the surface, so I can probably get a PR together for that too.Added mogrify support to Cursor (PyMySQL#476)
Add Cursor.mogrify(). (#477)