Skip to content

Commit

Permalink
Allow postgres client to read tables with UUID, JSON, JSONB types.
Browse files Browse the repository at this point in the history
  • Loading branch information
ian-r-rose committed Sep 26, 2019
1 parent be78e26 commit b514069
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ibis/expr/datatypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,9 @@ def _literal_value_hash_key(self, value) -> int:


class Any(DataType):
scalar = ir.AnyScalar
column = ir.AnyColumn

__slots__ = ()


Expand Down
15 changes: 15 additions & 0 deletions ibis/sql/alchemy.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,21 @@ def sa_double(_, satype, nullable=True):
return dt.Double(nullable=nullable)


@dt.dtype.register(PostgreSQLDialect, sa.dialects.postgresql.UUID)
def sa_uuid(_, satype, nullable=True):
return dt.Any(nullable=nullable)


@dt.dtype.register(PostgreSQLDialect, sa.dialects.postgresql.JSON)
def sa_json(_, satype, nullable=True):
return dt.Any(nullable=nullable)


@dt.dtype.register(PostgreSQLDialect, sa.dialects.postgresql.JSONB)
def sa_jsonb(_, satype, nullable=True):
return dt.Any(nullable=nullable)


if geospatial_supported:

@dt.dtype.register(SQLAlchemyDialect, (ga.Geometry, ga.types._GISType))
Expand Down

0 comments on commit b514069

Please sign in to comment.