PGDialect, PGCompiler, PGIdentifierPreparer, PGExecutionContext,
_DECIMAL_TYPES, _FLOAT_TYPES, _INT_TYPES)
import re
+from sqlalchemy.dialects.postgresql.json import JSON
class _PGNumeric(sqltypes.Numeric):
return None
+class _PGJSON(JSON):
+
+ def result_processor(self, dialect, coltype):
+ if dialect._dbapi_version > (1, 10, 1):
+ return None # Has native JSON
+ else:
+ return super(_PGJSON, self).result_processor(dialect, coltype)
+
+
class PGExecutionContext_pg8000(PGExecutionContext):
pass
PGDialect.colspecs,
{
sqltypes.Numeric: _PGNumericNoBind,
- sqltypes.Float: _PGNumeric
+ sqltypes.Float: _PGNumeric,
+ JSON: _PGJSON,
}
)