Skip to content

Commit ccb81a6

Browse files
committed
Types: Add method ObjectArray.as_generic
AFAIK, it is needed for reverse type lookups.
1 parent 435ec4e commit ccb81a6

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/sqlalchemy_cratedb/type/array.py

+5
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,8 @@ def __init__(self, left, right, operator=operators.eq):
9696
self.operator = operator
9797

9898

99+
# TODO: Should this be inherited from PostgreSQL's
100+
# `ARRAY`, in order to improve type checking?
99101
class _ObjectArray(sqltypes.UserDefinedType):
100102
cache_ok = True
101103

@@ -139,5 +141,8 @@ def any(self, other, operator=operators.eq):
139141
def get_col_spec(self, **kws):
140142
return "ARRAY(OBJECT)"
141143

144+
def as_generic(self, **kwargs):
145+
return sqltypes.ARRAY
146+
142147

143148
ObjectArray = MutableList.as_mutable(_ObjectArray)

0 commit comments

Comments
 (0)