Skip to content

Commit

Permalink
feat(mssql): add a bunch of missing types
Browse files Browse the repository at this point in the history
  • Loading branch information
cpcloud committed Jan 17, 2023
1 parent 490f8b4 commit c698d35
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions ibis/backends/base/sql/alchemy/datatypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ def sa_integer(_, satype, nullable=True):


@dt.dtype.register(Dialect, mysql.TINYINT)
@dt.dtype.register(MSDialect, mssql.TINYINT)
def sa_mysql_tinyint(_, satype, nullable=True):
return dt.Int8(nullable=nullable)

Expand All @@ -242,10 +243,16 @@ def sa_mysql_bit(_, satype, nullable=True):


@dt.dtype.register(Dialect, sa.types.BigInteger)
@dt.dtype.register(MSDialect, mssql.MONEY)
def sa_bigint(_, satype, nullable=True):
return dt.Int64(nullable=nullable)


@dt.dtype.register(MSDialect, mssql.SMALLMONEY)
def sa_mssql_smallmoney(_, satype, nullable=True):
return dt.Int32(nullable=nullable)


@dt.dtype.register(Dialect, sa.REAL)
def sa_real(_, satype, nullable=True):
return dt.Float32(nullable=nullable)
Expand All @@ -259,10 +266,16 @@ def sa_double(_, satype, nullable=True):


@dt.dtype.register(PGDialect, postgresql.UUID)
@dt.dtype.register(MSDialect, mssql.UNIQUEIDENTIFIER)
def sa_uuid(_, satype, nullable=True):
return dt.UUID(nullable=nullable)


@dt.dtype.register(MSDialect, (mssql.BINARY, mssql.TIMESTAMP))
def sa_mssql_timestamp(_, satype, nullable=True):
return dt.Binary(nullable=nullable)


@dt.dtype.register(PGDialect, postgresql.MACADDR)
def sa_macaddr(_, satype, nullable=True):
return dt.MACADDR(nullable=nullable)
Expand Down

0 comments on commit c698d35

Please sign in to comment.