Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Types: Add method ObjectArray.as_generic #23

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/sqlalchemy_cratedb/type/array.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@
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

Expand Down Expand Up @@ -140,5 +142,8 @@
def get_col_spec(self, **kws):
return "ARRAY(OBJECT)"

def as_generic(self, **kwargs):
return sqltypes.ARRAY

Check warning on line 146 in src/sqlalchemy_cratedb/type/array.py

View check run for this annotation

Codecov / codecov/patch

src/sqlalchemy_cratedb/type/array.py#L146

Added line #L146 was not covered by tests


ObjectArray = MutableList.as_mutable(_ObjectArray)