diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2016-07-24 23:14:47 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2016-07-24 23:14:47 -0400 |
commit | 96c4208bf83607120d2f716070ed22ee10312dd0 (patch) | |
tree | 309dc65cc4b24bb640300b77a85bd3cbf41c60ba /lib/sqlalchemy/dialects/mysql/json.py | |
parent | 98c66d19a0571fa0ddbffbe7846b698a9a97e0e9 (diff) | |
download | sqlalchemy-96c4208bf83607120d2f716070ed22ee10312dd0.tar.gz |
- MySQL's JSON shared implementation completely w/ sqltypes.JSON;
this must have been an oversight. Leave mysql.JSON in place still
as we might need to add things to it.
- CAST(json, String) still confusing MySQL drivers even mysqlclient.
Since here we're checking for the raw form of the JSON and not a typical
round trip, add a force for unicode
Change-Id: I727f4526a01a0875037cf0dede45cd074da5205a
Diffstat (limited to 'lib/sqlalchemy/dialects/mysql/json.py')
-rw-r--r-- | lib/sqlalchemy/dialects/mysql/json.py | 37 |
1 files changed, 1 insertions, 36 deletions
diff --git a/lib/sqlalchemy/dialects/mysql/json.py b/lib/sqlalchemy/dialects/mysql/json.py index b2d5a78b5..3840a7cd6 100644 --- a/lib/sqlalchemy/dialects/mysql/json.py +++ b/lib/sqlalchemy/dialects/mysql/json.py @@ -29,42 +29,7 @@ class JSON(sqltypes.JSON): """ - @util.memoized_property - def _str_impl(self): - return sqltypes.String(convert_unicode=True) - - def bind_processor(self, dialect): - string_process = self._str_impl.bind_processor(dialect) - - json_serializer = dialect._json_serializer or json.dumps - - def process(value): - if value is self.NULL: - value = None - elif isinstance(value, elements.Null) or ( - value is None and self.none_as_null - ): - return None - - serialized = json_serializer(value) - if string_process: - serialized = string_process(serialized) - return serialized - - return process - - def result_processor(self, dialect, coltype): - string_process = self._str_impl.result_processor(dialect, coltype) - json_deserializer = dialect._json_deserializer or json.loads - - def process(value): - if value is None: - return None - if string_process: - value = string_process(value) - return json_deserializer(value) - return process - + pass class JSONIndexType(sqltypes.JSON.JSONIndexType): def bind_processor(self, dialect): |