aiomysql icon indicating copy to clipboard operation
aiomysql copied to clipboard

Consider renaming mogrify() to something else.

Open gnat opened this issue 5 years ago • 2 comments

mogrify() is slang and not intuitive. Please consider renaming this to something more self-documenting like execute_preview() or query_preview() or preview()

"Returns the exact string that is sent to the database by calling the execute() method. "

https://github.com/aio-libs/aiomysql/blob/2eb8533d18b3a231231561a3ac881ce334f01312/aiomysql/cursors.py#L205

This is a useful helper, but right now it's nearly impossible to find without reading the code line-by-line.

Thanks!

gnat avatar Jun 15 '20 08:06 gnat

Hi @gnat,

this api is defined in PyMySQL, API changes should be coming from PyMySQL first.

It is however currently not part of aiomysql's documentation, so there's definitely room for improvement. Adding this to the documentation should mitigate the "nearly impossible to find" part.

Nothing4You avatar Jan 22 '22 23:01 Nothing4You

You're absolutely correct and agreed- an addition about this to the documentation would help.

gnat avatar Jan 23 '22 02:01 gnat