Skip to content

Commit

Permalink
add null to inser builder
Browse files Browse the repository at this point in the history
  • Loading branch information
sxwebdev authored May 28, 2024
1 parent 194e4e9 commit e7718ac
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions cast_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ func castType(value any) (string, error) {
return fmt.Sprintf("%v", v), nil
case tsfuncs.TDEngineFunc:
return v.String(), nil
case nil:
return "NULL", nil
default:
return "", fmt.Errorf("undefined type: %T", v)
}
Expand Down
2 changes: 1 addition & 1 deletion tsdbbuilder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func Test_Insert(t *testing.T) {
Columns("column_1", "column_2", "column_3").
Values(1, 2, tsfuncs.Now()).
Values(1, 2, tsfuncs.Abs("4321")).
Values(1, 2, 3)
Values(1, 2, nil)

// add table 2
b.AddTable("test_table_2").
Expand Down

0 comments on commit e7718ac

Please sign in to comment.