aiomysql icon indicating copy to clipboard operation
aiomysql copied to clipboard

allow extensions to escaping, for example numpy types

Open bcsaller opened this issue 6 years ago • 1 comments

This expects that when you extend converts you do so using the default as a base dict. I've used it as follows to include escape support for a couple of numpy types.

mysql_converters = { numpy.int64: pymysql.converters.escape_int, numpy.float64: pymysql.converters.escape_float, }

bcsaller avatar Jan 17 '19 00:01 bcsaller

Pretty sure encoders and decoders are dictionaries of different contents.

encoders is type -> conversion_function decoders is mysql field bit -> conversion_function

I think what your after is extending the encoders dict so that if you do inserts with numpy objects it'll convert them to standard python ones

terricain avatar Jan 17 '19 07:01 terricain