Skip to content

Commit

Permalink
make all array kinds nillable
Browse files Browse the repository at this point in the history
  • Loading branch information
nasdf committed Apr 19, 2024
1 parent 734b326 commit 8a71b16
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
8 changes: 4 additions & 4 deletions client/normal_nil.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@ func NewNormalNil(kind FieldKind) (NormalValue, error) {
return NewNormalNillableString(immutable.None[string]()), nil
case FieldKind_NILLABLE_BLOB:
return NewNormalNillableBytes(immutable.None[[]byte]()), nil
case FieldKind_NILLABLE_BOOL_ARRAY:
case FieldKind_BOOL_ARRAY, FieldKind_NILLABLE_BOOL_ARRAY:
return NewNormalBoolNillableArray(immutable.None[[]bool]()), nil
case FieldKind_NILLABLE_INT_ARRAY:
case FieldKind_INT_ARRAY, FieldKind_NILLABLE_INT_ARRAY:
return NewNormalIntNillableArray(immutable.None[[]int64]()), nil
case FieldKind_NILLABLE_FLOAT_ARRAY:
case FieldKind_FLOAT_ARRAY, FieldKind_NILLABLE_FLOAT_ARRAY:
return NewNormalFloatNillableArray(immutable.None[[]float64]()), nil
case FieldKind_NILLABLE_STRING_ARRAY:
case FieldKind_STRING_ARRAY, FieldKind_NILLABLE_STRING_ARRAY:
return NewNormalStringNillableArray(immutable.None[[]string]()), nil
default:
return nil, NewCanNotMakeNormalNilFromFieldKind(kind)
Expand Down
6 changes: 5 additions & 1 deletion client/schema_field_description.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,11 @@ func (k ScalarArrayKind) Underlying() string {
}

func (k ScalarArrayKind) IsNillable() bool {
return k == FieldKind_NILLABLE_BOOL_ARRAY ||
return k == FieldKind_BOOL_ARRAY ||
k == FieldKind_INT_ARRAY ||
k == FieldKind_FLOAT_ARRAY ||
k == FieldKind_STRING_ARRAY ||
k == FieldKind_NILLABLE_BOOL_ARRAY ||
k == FieldKind_NILLABLE_INT_ARRAY ||
k == FieldKind_NILLABLE_FLOAT_ARRAY ||
k == FieldKind_NILLABLE_STRING_ARRAY
Expand Down

0 comments on commit 8a71b16

Please sign in to comment.