diff --git a/src/sqlalchemy_cratedb/type/array.py b/src/sqlalchemy_cratedb/type/array.py index ae68d4b4..a95b8075 100644 --- a/src/sqlalchemy_cratedb/type/array.py +++ b/src/sqlalchemy_cratedb/type/array.py @@ -95,6 +95,8 @@ def __init__(self, left, right, operator=operators.eq): self.operator = operator +# TODO: Should this be inherited from PostgreSQL's +# `ARRAY`, in order to improve type checking? class _ObjectArray(sqltypes.UserDefinedType): cache_ok = True @@ -140,5 +142,8 @@ def any(self, other, operator=operators.eq): def get_col_spec(self, **kws): return "ARRAY(OBJECT)" + def as_generic(self, **kwargs): + return sqltypes.ARRAY + ObjectArray = MutableList.as_mutable(_ObjectArray)