Makes sense. I modified my code to look like this for cross DB
compatibility - which I believe is identical to the workaround you mention
in issue #3891 - I'm pasting it here for others who may face the same
problem:
class _cast_on_mysql(ColumnElement):
def __init__(self, bindvalue, *args,
On Fri, Jul 28, 2017 at 1:46 PM, Samer Atiani wrote:
> The way I'm handling this is by creating a TypeDecorator with the following
> function:
>
>
> def bind_expression(self, value):
> """
> The objective of this is to force MySQL to deal with bind
>
Unless you need to use all the readings immediately, have you considered
just making a custom def under the Sensor model, and then inserting all the
readings via sqlalchemy core? That would allow you to insert them without
creating ORM objects, which people using numpy and a lot of data often
The way I'm handling this is by creating a TypeDecorator with the following
function:
def bind_expression(self, value):
"""
The objective of this is to force MySQL to deal with bind
parameters as
decimals rather than as strings. MySQL for some insane reason