Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ version: 2.1
jobs:
test:
docker:
- image: golang:1.23-bullseye
- image: golang:1.24-bullseye
environment:
SPANNER_EMULATOR_HOST: localhost:9010
SPANNER_EMULATOR_HOST_REST: localhost:9020
Expand Down Expand Up @@ -55,7 +55,7 @@ jobs:

v2test:
docker:
- image: golang:1.23-bullseye
- image: golang:1.24-bullseye
environment:
SPANNER_EMULATOR_HOST: localhost:9010
SPANNER_EMULATOR_HOST_REST: localhost:9020
Expand Down Expand Up @@ -100,7 +100,7 @@ jobs:
make -C v2 check-diff
check_lint:
docker:
- image: golang:1.23-bullseye
- image: golang:1.24-bullseye
working_directory: /go/src/github.com/cloudspannerecosystem/yo
steps:
- checkout
Expand All @@ -110,7 +110,7 @@ jobs:
make check_lint
check_go_mod:
docker:
- image: golang:1.23-bullseye
- image: golang:1.24-bullseye
working_directory: /go/src/github.com/cloudspannerecosystem/yo
steps:
- checkout
Expand Down
3 changes: 2 additions & 1 deletion loaders/spanner.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,8 @@ func SpanParseType(dt string, nullable bool) (int, string, string) {
default:
if strings.HasPrefix(dt, "ARRAY<") {
eleDataType := strings.TrimSuffix(strings.TrimPrefix(dt, "ARRAY<"), ">")
_, _, eleTyp := SpanParseType(eleDataType, false)
// Array type can contain NULL elements. See https://cloud.google.com/spanner/docs/reference/standard-sql/data-types#array_nulls
_, _, eleTyp := SpanParseType(eleDataType, true)
typ, nilVal = "[]"+eleTyp, "nil"
if !nullable {
nilVal = typ + "{}"
Expand Down
62 changes: 31 additions & 31 deletions test/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -338,20 +338,20 @@ func TestDefaultFullType(t *testing.T) {
},
FTJSON: json,
FTJSONNull: json,
FTArrayStringNull: []string{"xxx1", "yyy1"},
FTArrayString: []string{"xxx1", "yyy1"},
FTArrayBoolNull: []bool{true, false},
FTArrayBool: []bool{true, false},
FTArrayStringNull: []spanner.NullString{{StringVal: "xxx1", Valid: true}, {StringVal: "yyy1", Valid: true}},
FTArrayString: []spanner.NullString{{StringVal: "xxx1", Valid: true}, {StringVal: "yyy1", Valid: true}},
FTArrayBoolNull: []spanner.NullBool{{Bool: true, Valid: true}, {Bool: false, Valid: true}},
FTArrayBool: []spanner.NullBool{{Bool: true, Valid: true}, {Bool: false, Valid: true}},
FTArrayBytesNull: [][]byte{[]byte("xxx1"), []byte("yyy1")},
FTArrayBytes: [][]byte{[]byte("xxx1"), []byte("yyy1")},
FTArrayTimestampNull: []time.Time{now, tomorrow},
FTArrayTimestamp: []time.Time{now, tomorrow},
FTArrayIntNull: []int64{100, 200},
FTArrayInt: []int64{100, 200},
FTArrayFloatNull: []float64{0.111, 0.222},
FTArrayFloat: []float64{0.111, 0.222},
FTArrayDateNull: []civil.Date{date, nextdate},
FTArrayDate: []civil.Date{date, nextdate},
FTArrayTimestampNull: []spanner.NullTime{{Time: now, Valid: true}, {Time: tomorrow, Valid: true}},
FTArrayTimestamp: []spanner.NullTime{{Time: now, Valid: true}, {Time: tomorrow, Valid: true}},
FTArrayIntNull: []spanner.NullInt64{{Int64: 100, Valid: true}, {Int64: 200, Valid: true}},
FTArrayInt: []spanner.NullInt64{{Int64: 100, Valid: true}, {Int64: 200, Valid: true}},
FTArrayFloatNull: []spanner.NullFloat64{{Float64: 0.111, Valid: true}, {Float64: 0.222, Valid: true}},
FTArrayFloat: []spanner.NullFloat64{{Float64: 0.111, Valid: true}, {Float64: 0.222, Valid: true}},
FTArrayDateNull: []spanner.NullDate{{Date: date, Valid: true}, {Date: nextdate, Valid: true}},
FTArrayDate: []spanner.NullDate{{Date: date, Valid: true}, {Date: nextdate, Valid: true}},
FTArrayJSONNull: []spanner.NullJSON{json, jsonNull},
FTArrayJSON: []spanner.NullJSON{json, jsonNull},
},
Expand All @@ -375,20 +375,20 @@ func TestDefaultFullType(t *testing.T) {
FTDateNull: spanner.NullDate{},
FTJSON: json,
FTJSONNull: jsonNull,
FTArrayStringNull: []string{"xxx2", "yyy2"},
FTArrayString: []string{"xxx2", "yyy2"},
FTArrayStringNull: []spanner.NullString{{StringVal: "xxx2", Valid: true}, {StringVal: "yyy2", Valid: true}},
FTArrayString: []spanner.NullString{{StringVal: "xxx2", Valid: true}, {StringVal: "yyy2", Valid: true}},
FTArrayBoolNull: nil,
FTArrayBool: []bool{true, false},
FTArrayBool: []spanner.NullBool{{Bool: true, Valid: true}, {Bool: false, Valid: true}},
FTArrayBytesNull: nil,
FTArrayBytes: [][]byte{[]byte("xxx2"), []byte("yyy2")},
FTArrayTimestampNull: nil,
FTArrayTimestamp: []time.Time{now, tomorrow},
FTArrayTimestamp: []spanner.NullTime{{Time: now, Valid: true}, {Time: tomorrow, Valid: true}},
FTArrayIntNull: nil,
FTArrayInt: []int64{100, 200},
FTArrayInt: []spanner.NullInt64{{Int64: 100, Valid: true}, {Int64: 200, Valid: true}},
FTArrayFloatNull: nil,
FTArrayFloat: []float64{0.111, 0.222},
FTArrayFloat: []spanner.NullFloat64{{Float64: 0.111, Valid: true}, {Float64: 0.222, Valid: true}},
FTArrayDateNull: nil,
FTArrayDate: []civil.Date{date, nextdate},
FTArrayDate: []spanner.NullDate{{Date: date, Valid: true}, {Date: nextdate, Valid: true}},
FTArrayJSONNull: nil,
FTArrayJSON: []spanner.NullJSON{json, jsonNull},
},
Expand All @@ -412,20 +412,20 @@ func TestDefaultFullType(t *testing.T) {
FTDateNull: spanner.NullDate{},
FTJSON: json,
FTJSONNull: jsonNull,
FTArrayStringNull: []string{},
FTArrayString: []string{},
FTArrayBoolNull: []bool{},
FTArrayBool: []bool{},
FTArrayStringNull: []spanner.NullString{},
FTArrayString: []spanner.NullString{},
FTArrayBoolNull: []spanner.NullBool{},
FTArrayBool: []spanner.NullBool{},
FTArrayBytesNull: [][]byte{},
FTArrayBytes: [][]byte{},
FTArrayTimestampNull: []time.Time{},
FTArrayTimestamp: []time.Time{},
FTArrayIntNull: []int64{},
FTArrayInt: []int64{},
FTArrayFloatNull: []float64{},
FTArrayFloat: []float64{},
FTArrayDateNull: []civil.Date{},
FTArrayDate: []civil.Date{},
FTArrayTimestampNull: []spanner.NullTime{},
FTArrayTimestamp: []spanner.NullTime{},
FTArrayIntNull: []spanner.NullInt64{},
FTArrayInt: []spanner.NullInt64{},
FTArrayFloatNull: []spanner.NullFloat64{},
FTArrayFloat: []spanner.NullFloat64{},
FTArrayDateNull: []spanner.NullDate{},
FTArrayDate: []spanner.NullDate{},
FTArrayJSONNull: []spanner.NullJSON{},
FTArrayJSON: []spanner.NullJSON{},
},
Expand Down
66 changes: 33 additions & 33 deletions test/testmodels/customtypes/fulltype.yo.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading