Skip to content

Conversation

bcsaller
Copy link

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,
}

@terricain
Copy link
Collaborator

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants