From ebaa657a9533caf10ae96179fdc05f02f8316ab2 Mon Sep 17 00:00:00 2001 From: Robin Tang Date: Tue, 15 Oct 2024 17:38:33 -0700 Subject: [PATCH] Support this into MSSQL. --- clients/mssql/dialect/dialect.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/clients/mssql/dialect/dialect.go b/clients/mssql/dialect/dialect.go index dc63c049c..ac7b8207d 100644 --- a/clients/mssql/dialect/dialect.go +++ b/clients/mssql/dialect/dialect.go @@ -56,6 +56,8 @@ func (MSSQLDialect) DataTypeForKind(kindDetails typing.KindDetails, isPk bool) s case typing.ETime.Kind: switch kindDetails.ExtendedTimeDetails.Type { case ext.TimestampTzKindType: + return "datetimeoffset" + case ext.TimestampNTZKindType: // Using datetime2 because it's the recommendation, and it provides more precision: https://stackoverflow.com/a/1884088 return "datetime2" case ext.DateKindType: @@ -114,6 +116,8 @@ func (MSSQLDialect) KindForDataType(rawType string, stringPrecision string) (typ case "datetime", "datetime2": + return typing.NewKindDetailsFromTemplate(typing.ETime, ext.TimestampNTZKindType), nil + case "datetimeoffset": return typing.NewKindDetailsFromTemplate(typing.ETime, ext.TimestampTzKindType), nil case "time": return typing.NewKindDetailsFromTemplate(typing.ETime, ext.TimeKindType), nil