Skip to content

Commit

Permalink
Add Microsoft SQL data types that where not supported
Browse files Browse the repository at this point in the history
  • Loading branch information
ruiscosta committed Apr 7, 2023
1 parent 9a4328f commit 57df514
Showing 1 changed file with 36 additions and 19 deletions.
55 changes: 36 additions & 19 deletions api/archive/source/get-schema/lib/mssql.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,37 +31,54 @@
def convert_schema(type):
if "char" in type:
return "string"

elif "datetime" == type:
return "timestamp"

elif "date" == type:
return "date"

elif "money" == type:
return "decimal(19,4)"

elif "smallmoney" == type:
return "decimal(10,4)"

elif "geography" == type:
return "binary"

elif "numeric" == type:
return "decimal(38,6)"

elif "hierarchyid" == type:
return "binary"

elif "int" in type:
if type == "bigint":
return "long"
elif type == "smallint":
return "smallint"
else:
return "int"
elif "date" in type:
return "date"
elif "decimal" in type:
return "decimal"
elif "money" in type:

elif "decimal" == type:
return "decimal"
elif "bit" in type:
return "tinyint"
elif "uniqueidentifier" in type:
return "string"
elif "xml" in type:

elif "bit" == type:
return "boolean"

elif "uniqueidentifier" == type:
return "string"
elif "xml" in type:

elif "xml" == type:
return "string"
elif "numeric" in type:
return "int"
elif "time" in type:

elif "time" == type:
return "timestamp"
elif "varbinary" in type:

elif "varbinary" == type:
return "binary"
elif "geography" in type:
return "string"
elif "hierarchyid" in type:
return "string"

else:
return "string"

Expand Down

0 comments on commit 57df514

Please sign in to comment.