Skip to content

Commit

Permalink
Error
Browse files Browse the repository at this point in the history
  • Loading branch information
nathan-artie committed May 2, 2024
1 parent 2efc389 commit 2a6eb2f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
4 changes: 4 additions & 0 deletions lib/typing/columns/default.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@ func (c *Column) DefaultValue(dialect sql.Dialect, additionalDateFmts []string)
return fmt.Sprintf("JSON_PARSE(%s)", stringutil.Wrap(c.defaultValue, false)), nil
case sql.SnowflakeDialect:
return stringutil.Wrap(c.defaultValue, false), nil
default:
// Note that we don't currently support backfills for MS SQL.
return nil, fmt.Errorf("not implemented for %v dialect", dialect)
}

case typing.ETime.Kind:
if c.KindDetails.ExtendedTimeDetails == nil {
return nil, fmt.Errorf("column kind details for extended time is nil")
Expand Down
9 changes: 4 additions & 5 deletions lib/typing/columns/default_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import (

var dialects = []sql.Dialect{
sql.BigQueryDialect{},
sql.MSSQLDialect{},
sql.RedshiftDialect{},
sql.SnowflakeDialect{UppercaseEscNames: true},
}
Expand Down Expand Up @@ -68,8 +67,8 @@ func TestColumn_DefaultValue(t *testing.T) {
expectedValue: `{}`,
destKindToExpectedValueMap: map[sql.Dialect]any{
dialects[0]: "JSON'{}'",
dialects[2]: `JSON_PARSE('{}')`,
dialects[3]: `'{}'`,
dialects[1]: `JSON_PARSE('{}')`,
dialects[2]: `'{}'`,
},
},
{
Expand All @@ -81,8 +80,8 @@ func TestColumn_DefaultValue(t *testing.T) {
expectedValue: "{\"age\": 0, \"membership_level\": \"standard\"}",
destKindToExpectedValueMap: map[sql.Dialect]any{
dialects[0]: "JSON'{\"age\": 0, \"membership_level\": \"standard\"}'",
dialects[2]: "JSON_PARSE('{\"age\": 0, \"membership_level\": \"standard\"}')",
dialects[3]: "'{\"age\": 0, \"membership_level\": \"standard\"}'",
dialects[1]: "JSON_PARSE('{\"age\": 0, \"membership_level\": \"standard\"}')",
dialects[2]: "'{\"age\": 0, \"membership_level\": \"standard\"}'",
},
},
{
Expand Down

0 comments on commit 2a6eb2f

Please sign in to comment.