summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/sqlalchemy/dialects/postgresql/pg8000.py1
-rw-r--r--lib/sqlalchemy/testing/requirements.py7
-rw-r--r--lib/sqlalchemy/testing/suite/test_types.py1
-rw-r--r--test/requirements.py4
4 files changed, 13 insertions, 0 deletions
diff --git a/lib/sqlalchemy/dialects/postgresql/pg8000.py b/lib/sqlalchemy/dialects/postgresql/pg8000.py
index c71f689a3..2c745e6f7 100644
--- a/lib/sqlalchemy/dialects/postgresql/pg8000.py
+++ b/lib/sqlalchemy/dialects/postgresql/pg8000.py
@@ -155,6 +155,7 @@ class PGDialect_pg8000(PGDialect):
sqltypes.Numeric: _PGNumericNoBind,
sqltypes.Float: _PGNumeric,
JSON: _PGJSON,
+ sqltypes.JSON: _PGJSON
}
)
diff --git a/lib/sqlalchemy/testing/requirements.py b/lib/sqlalchemy/testing/requirements.py
index 87c776e8c..1b5d6e883 100644
--- a/lib/sqlalchemy/testing/requirements.py
+++ b/lib/sqlalchemy/testing/requirements.py
@@ -493,6 +493,13 @@ class SuiteRequirements(Requirements):
return exclusions.closed()
@property
+ def json_array_indexes(self):
+ """"target platform supports numeric array indexes
+ within a JSON structure"""
+
+ return self.json_type
+
+ @property
def precision_numerics_general(self):
"""target backend has general support for moderately high-precision
numerics."""
diff --git a/lib/sqlalchemy/testing/suite/test_types.py b/lib/sqlalchemy/testing/suite/test_types.py
index f2103f89a..6231e0fb9 100644
--- a/lib/sqlalchemy/testing/suite/test_types.py
+++ b/lib/sqlalchemy/testing/suite/test_types.py
@@ -759,6 +759,7 @@ class JSONTest(_LiteralRoundTripFixture, fixtures.TablesTest):
"r2"
)
+ @config.requirements.json_array_indexes
def test_crit_simple_int(self):
name = self.tables.data_table.c.name
col = self.tables.data_table.c['data']
diff --git a/test/requirements.py b/test/requirements.py
index 7031a70dc..522a376e0 100644
--- a/test/requirements.py
+++ b/test/requirements.py
@@ -539,6 +539,10 @@ class DefaultRequirements(SuiteRequirements):
])
@property
+ def json_array_indexes(self):
+ return self.json_type + fails_if("+pg8000")
+
+ @property
def datetime_literals(self):
"""target dialect supports rendering of a date, time, or datetime as a
literal string, e.g. via the TypeEngine.literal_processor() method.