Skip to content

Commit

Permalink
test: Array(Nullable(Int8)), Nullable(DateTime64(3))
Browse files Browse the repository at this point in the history
couple fixes needed to get these cases to work
  • Loading branch information
serprex committed Oct 13, 2024
1 parent 7756809 commit eb34d86
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions proto/col_auto_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ func TestColAuto_Infer(t *testing.T) {
ColumnTypeUUID,
ColumnTypeArray.Sub(ColumnTypeUUID),
ColumnTypeNullable.Sub(ColumnTypeUUID),
"Array(Nullable(Int8))",
"Nullable(DateTime64(3))",
} {
r := AutoResult("foo")
require.NoError(t, r.Data.(Inferable).Infer(columnType))
Expand Down
4 changes: 4 additions & 0 deletions proto/col_datetime64.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,10 @@ func (c ColDateTime64) Raw() *ColDateTime64Raw {
return &ColDateTime64Raw{ColDateTime64: c}
}

func (c *ColDateTime64) Nullable() *ColNullable[time.Time] {
return &ColNullable[time.Time]{Values: c}
}

func (c *ColDateTime64) Array() *ColArr[time.Time] {
return &ColArr[time.Time]{Data: c}
}
Expand Down
6 changes: 6 additions & 0 deletions proto/col_nullable.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,12 @@ func (c ColNullable[T]) Row(i int) Nullable[T] {
}
}

func (c *ColNullable[T]) Array() *ColArr[Nullable[T]] {
return &ColArr[Nullable[T]]{
Data: c,
}
}

func (c *ColNullable[T]) Reset() {
c.Nulls.Reset()
c.Values.Reset()
Expand Down

0 comments on commit eb34d86

Please sign in to comment.