Skip to content

Commit 6092c68

Browse files
committed
Types: Add method ObjectArray.as_generic
AFAIK, it is needed for reverse type lookups.
1 parent 07bba7b commit 6092c68

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
@@ -95,6 +95,8 @@ def __init__(self, left, right, operator=operators.eq):
9595
self.operator = operator
9696

9797

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

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

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

144149
ObjectArray = MutableList.as_mutable(_ObjectArray)

0 commit comments

Comments
 (0)