From ea2b8fb9d5a1dd69f005424efca5176057665cec Mon Sep 17 00:00:00 2001 From: Yuki Okushi Date: Wed, 15 Jun 2022 12:07:28 +0900 Subject: [PATCH] Fix a "retrives" typo `does not retrives` -> `does not retrieve` Signed-off-by: Yuki Okushi --- templates/index.go.tpl | 2 +- .../customtypes/compositeprimarykey.yo.go | 8 ++++---- test/testmodels/customtypes/fulltype.yo.go | 10 +++++----- test/testmodels/customtypes/snakecase.yo.go | 2 +- .../default/compositeprimarykey.yo.go | 8 ++++---- test/testmodels/default/fulltype.yo.go | 10 +++++----- test/testmodels/default/snakecase.yo.go | 2 +- test/testmodels/single/single_file.go | 20 +++++++++---------- tplbin/templates.go | 2 +- v2/module/builtin/templates/index.go.tpl | 2 +- .../builtin/templates/legacy_index.go.tpl | 2 +- .../default/composite_primary_key.yo.go | 8 ++++---- .../custom_composite_primary_key.yo.go | 8 ++++---- v2/test/testmodels/default/full_type.yo.go | 10 +++++----- v2/test/testmodels/default/snake_case.yo.go | 2 +- .../composite_primary_key.yo.go | 8 ++++---- .../custom_composite_primary_key.yo.go | 8 ++++---- .../testmodels/legacy_default/full_type.yo.go | 10 +++++----- .../legacy_default/snake_case.yo.go | 2 +- 19 files changed, 62 insertions(+), 62 deletions(-) diff --git a/templates/index.go.tpl b/templates/index.go.tpl index 3dbbced..8dd102f 100644 --- a/templates/index.go.tpl +++ b/templates/index.go.tpl @@ -101,7 +101,7 @@ func Find{{ .FuncName }}(ctx context.Context, db YORODB{{ gocustomparamlist .Fie // Read{{ .FuncName }} retrieves multiples rows from '{{ $table }}' by KeySet as a slice. // -// This does not retrives all columns of '{{ $table }}' because an index has only columns +// This does not retrieve all columns of '{{ $table }}' because an index has only columns // used for primary key, index key and storing columns. If you need more columns, add storing // columns or Read by primary key or Query with join. // diff --git a/test/testmodels/customtypes/compositeprimarykey.yo.go b/test/testmodels/customtypes/compositeprimarykey.yo.go index ce610ae..f3b6bbc 100644 --- a/test/testmodels/customtypes/compositeprimarykey.yo.go +++ b/test/testmodels/customtypes/compositeprimarykey.yo.go @@ -263,7 +263,7 @@ func FindCompositePrimaryKeysByError(ctx context.Context, db YORODB, e int8) ([] // ReadCompositePrimaryKeysByError retrieves multiples rows from 'CompositePrimaryKeys' by KeySet as a slice. // -// This does not retrives all columns of 'CompositePrimaryKeys' because an index has only columns +// This does not retrieve all columns of 'CompositePrimaryKeys' because an index has only columns // used for primary key, index key and storing columns. If you need more columns, add storing // columns or Read by primary key or Query with join. // @@ -338,7 +338,7 @@ func FindCompositePrimaryKeysByZError(ctx context.Context, db YORODB, e int8) ([ // ReadCompositePrimaryKeysByZError retrieves multiples rows from 'CompositePrimaryKeys' by KeySet as a slice. // -// This does not retrives all columns of 'CompositePrimaryKeys' because an index has only columns +// This does not retrieve all columns of 'CompositePrimaryKeys' because an index has only columns // used for primary key, index key and storing columns. If you need more columns, add storing // columns or Read by primary key or Query with join. // @@ -414,7 +414,7 @@ func FindCompositePrimaryKeysByZYError(ctx context.Context, db YORODB, e int8) ( // ReadCompositePrimaryKeysByZYError retrieves multiples rows from 'CompositePrimaryKeys' by KeySet as a slice. // -// This does not retrives all columns of 'CompositePrimaryKeys' because an index has only columns +// This does not retrieve all columns of 'CompositePrimaryKeys' because an index has only columns // used for primary key, index key and storing columns. If you need more columns, add storing // columns or Read by primary key or Query with join. // @@ -492,7 +492,7 @@ func FindCompositePrimaryKeysByXY(ctx context.Context, db YORODB, x string, y st // ReadCompositePrimaryKeysByXY retrieves multiples rows from 'CompositePrimaryKeys' by KeySet as a slice. // -// This does not retrives all columns of 'CompositePrimaryKeys' because an index has only columns +// This does not retrieve all columns of 'CompositePrimaryKeys' because an index has only columns // used for primary key, index key and storing columns. If you need more columns, add storing // columns or Read by primary key or Query with join. // diff --git a/test/testmodels/customtypes/fulltype.yo.go b/test/testmodels/customtypes/fulltype.yo.go index 8def356..e46e9b7 100644 --- a/test/testmodels/customtypes/fulltype.yo.go +++ b/test/testmodels/customtypes/fulltype.yo.go @@ -441,7 +441,7 @@ func FindFullTypeByFTString(ctx context.Context, db YORODB, fTString string) (*F // ReadFullTypeByFTString retrieves multiples rows from 'FullTypes' by KeySet as a slice. // -// This does not retrives all columns of 'FullTypes' because an index has only columns +// This does not retrieve all columns of 'FullTypes' because an index has only columns // used for primary key, index key and storing columns. If you need more columns, add storing // columns or Read by primary key or Query with join. // @@ -524,7 +524,7 @@ func FindFullTypesByFTIntFTTimestampNull(ctx context.Context, db YORODB, fTInt i // ReadFullTypesByFTIntFTTimestampNull retrieves multiples rows from 'FullTypes' by KeySet as a slice. // -// This does not retrives all columns of 'FullTypes' because an index has only columns +// This does not retrieve all columns of 'FullTypes' because an index has only columns // used for primary key, index key and storing columns. If you need more columns, add storing // columns or Read by primary key or Query with join. // @@ -600,7 +600,7 @@ func FindFullTypesByFTIntFTDate(ctx context.Context, db YORODB, fTInt int32, fTD // ReadFullTypesByFTIntFTDate retrieves multiples rows from 'FullTypes' by KeySet as a slice. // -// This does not retrives all columns of 'FullTypes' because an index has only columns +// This does not retrieve all columns of 'FullTypes' because an index has only columns // used for primary key, index key and storing columns. If you need more columns, add storing // columns or Read by primary key or Query with join. // @@ -676,7 +676,7 @@ func FindFullTypesByFTIntFTTimestamp(ctx context.Context, db YORODB, fTInt int32 // ReadFullTypesByFTIntFTTimestamp retrieves multiples rows from 'FullTypes' by KeySet as a slice. // -// This does not retrives all columns of 'FullTypes' because an index has only columns +// This does not retrieve all columns of 'FullTypes' because an index has only columns // used for primary key, index key and storing columns. If you need more columns, add storing // columns or Read by primary key or Query with join. // @@ -751,7 +751,7 @@ func FindFullTypesByFTTimestamp(ctx context.Context, db YORODB, fTTimestamp time // ReadFullTypesByFTTimestamp retrieves multiples rows from 'FullTypes' by KeySet as a slice. // -// This does not retrives all columns of 'FullTypes' because an index has only columns +// This does not retrieve all columns of 'FullTypes' because an index has only columns // used for primary key, index key and storing columns. If you need more columns, add storing // columns or Read by primary key or Query with join. // diff --git a/test/testmodels/customtypes/snakecase.yo.go b/test/testmodels/customtypes/snakecase.yo.go index c5d25ef..22d7cdb 100644 --- a/test/testmodels/customtypes/snakecase.yo.go +++ b/test/testmodels/customtypes/snakecase.yo.go @@ -225,7 +225,7 @@ func FindSnakeCasesByStringIDFooBarBaz(ctx context.Context, db YORODB, stringID // ReadSnakeCasesByStringIDFooBarBaz retrieves multiples rows from 'snake_cases' by KeySet as a slice. // -// This does not retrives all columns of 'snake_cases' because an index has only columns +// This does not retrieve all columns of 'snake_cases' because an index has only columns // used for primary key, index key and storing columns. If you need more columns, add storing // columns or Read by primary key or Query with join. // diff --git a/test/testmodels/default/compositeprimarykey.yo.go b/test/testmodels/default/compositeprimarykey.yo.go index 9cfa456..c6ed955 100644 --- a/test/testmodels/default/compositeprimarykey.yo.go +++ b/test/testmodels/default/compositeprimarykey.yo.go @@ -253,7 +253,7 @@ func FindCompositePrimaryKeysByError(ctx context.Context, db YORODB, e int64) ([ // ReadCompositePrimaryKeysByError retrieves multiples rows from 'CompositePrimaryKeys' by KeySet as a slice. // -// This does not retrives all columns of 'CompositePrimaryKeys' because an index has only columns +// This does not retrieve all columns of 'CompositePrimaryKeys' because an index has only columns // used for primary key, index key and storing columns. If you need more columns, add storing // columns or Read by primary key or Query with join. // @@ -328,7 +328,7 @@ func FindCompositePrimaryKeysByZError(ctx context.Context, db YORODB, e int64) ( // ReadCompositePrimaryKeysByZError retrieves multiples rows from 'CompositePrimaryKeys' by KeySet as a slice. // -// This does not retrives all columns of 'CompositePrimaryKeys' because an index has only columns +// This does not retrieve all columns of 'CompositePrimaryKeys' because an index has only columns // used for primary key, index key and storing columns. If you need more columns, add storing // columns or Read by primary key or Query with join. // @@ -404,7 +404,7 @@ func FindCompositePrimaryKeysByZYError(ctx context.Context, db YORODB, e int64) // ReadCompositePrimaryKeysByZYError retrieves multiples rows from 'CompositePrimaryKeys' by KeySet as a slice. // -// This does not retrives all columns of 'CompositePrimaryKeys' because an index has only columns +// This does not retrieve all columns of 'CompositePrimaryKeys' because an index has only columns // used for primary key, index key and storing columns. If you need more columns, add storing // columns or Read by primary key or Query with join. // @@ -482,7 +482,7 @@ func FindCompositePrimaryKeysByXY(ctx context.Context, db YORODB, x string, y st // ReadCompositePrimaryKeysByXY retrieves multiples rows from 'CompositePrimaryKeys' by KeySet as a slice. // -// This does not retrives all columns of 'CompositePrimaryKeys' because an index has only columns +// This does not retrieve all columns of 'CompositePrimaryKeys' because an index has only columns // used for primary key, index key and storing columns. If you need more columns, add storing // columns or Read by primary key or Query with join. // diff --git a/test/testmodels/default/fulltype.yo.go b/test/testmodels/default/fulltype.yo.go index ef6eaea..1e3246b 100644 --- a/test/testmodels/default/fulltype.yo.go +++ b/test/testmodels/default/fulltype.yo.go @@ -434,7 +434,7 @@ func FindFullTypeByFTString(ctx context.Context, db YORODB, fTString string) (*F // ReadFullTypeByFTString retrieves multiples rows from 'FullTypes' by KeySet as a slice. // -// This does not retrives all columns of 'FullTypes' because an index has only columns +// This does not retrieve all columns of 'FullTypes' because an index has only columns // used for primary key, index key and storing columns. If you need more columns, add storing // columns or Read by primary key or Query with join. // @@ -517,7 +517,7 @@ func FindFullTypesByFTIntFTTimestampNull(ctx context.Context, db YORODB, fTInt i // ReadFullTypesByFTIntFTTimestampNull retrieves multiples rows from 'FullTypes' by KeySet as a slice. // -// This does not retrives all columns of 'FullTypes' because an index has only columns +// This does not retrieve all columns of 'FullTypes' because an index has only columns // used for primary key, index key and storing columns. If you need more columns, add storing // columns or Read by primary key or Query with join. // @@ -593,7 +593,7 @@ func FindFullTypesByFTIntFTDate(ctx context.Context, db YORODB, fTInt int64, fTD // ReadFullTypesByFTIntFTDate retrieves multiples rows from 'FullTypes' by KeySet as a slice. // -// This does not retrives all columns of 'FullTypes' because an index has only columns +// This does not retrieve all columns of 'FullTypes' because an index has only columns // used for primary key, index key and storing columns. If you need more columns, add storing // columns or Read by primary key or Query with join. // @@ -669,7 +669,7 @@ func FindFullTypesByFTIntFTTimestamp(ctx context.Context, db YORODB, fTInt int64 // ReadFullTypesByFTIntFTTimestamp retrieves multiples rows from 'FullTypes' by KeySet as a slice. // -// This does not retrives all columns of 'FullTypes' because an index has only columns +// This does not retrieve all columns of 'FullTypes' because an index has only columns // used for primary key, index key and storing columns. If you need more columns, add storing // columns or Read by primary key or Query with join. // @@ -744,7 +744,7 @@ func FindFullTypesByFTTimestamp(ctx context.Context, db YORODB, fTTimestamp time // ReadFullTypesByFTTimestamp retrieves multiples rows from 'FullTypes' by KeySet as a slice. // -// This does not retrives all columns of 'FullTypes' because an index has only columns +// This does not retrieve all columns of 'FullTypes' because an index has only columns // used for primary key, index key and storing columns. If you need more columns, add storing // columns or Read by primary key or Query with join. // diff --git a/test/testmodels/default/snakecase.yo.go b/test/testmodels/default/snakecase.yo.go index 2bb9b0f..d38836b 100644 --- a/test/testmodels/default/snakecase.yo.go +++ b/test/testmodels/default/snakecase.yo.go @@ -225,7 +225,7 @@ func FindSnakeCasesByStringIDFooBarBaz(ctx context.Context, db YORODB, stringID // ReadSnakeCasesByStringIDFooBarBaz retrieves multiples rows from 'snake_cases' by KeySet as a slice. // -// This does not retrives all columns of 'snake_cases' because an index has only columns +// This does not retrieve all columns of 'snake_cases' because an index has only columns // used for primary key, index key and storing columns. If you need more columns, add storing // columns or Read by primary key or Query with join. // diff --git a/test/testmodels/single/single_file.go b/test/testmodels/single/single_file.go index 28a3248..8fea24c 100644 --- a/test/testmodels/single/single_file.go +++ b/test/testmodels/single/single_file.go @@ -1585,7 +1585,7 @@ func FindCompositePrimaryKeysByError(ctx context.Context, db YORODB, e int64) ([ // ReadCompositePrimaryKeysByError retrieves multiples rows from 'CompositePrimaryKeys' by KeySet as a slice. // -// This does not retrives all columns of 'CompositePrimaryKeys' because an index has only columns +// This does not retrieve all columns of 'CompositePrimaryKeys' because an index has only columns // used for primary key, index key and storing columns. If you need more columns, add storing // columns or Read by primary key or Query with join. // @@ -1660,7 +1660,7 @@ func FindCompositePrimaryKeysByZError(ctx context.Context, db YORODB, e int64) ( // ReadCompositePrimaryKeysByZError retrieves multiples rows from 'CompositePrimaryKeys' by KeySet as a slice. // -// This does not retrives all columns of 'CompositePrimaryKeys' because an index has only columns +// This does not retrieve all columns of 'CompositePrimaryKeys' because an index has only columns // used for primary key, index key and storing columns. If you need more columns, add storing // columns or Read by primary key or Query with join. // @@ -1736,7 +1736,7 @@ func FindCompositePrimaryKeysByZYError(ctx context.Context, db YORODB, e int64) // ReadCompositePrimaryKeysByZYError retrieves multiples rows from 'CompositePrimaryKeys' by KeySet as a slice. // -// This does not retrives all columns of 'CompositePrimaryKeys' because an index has only columns +// This does not retrieve all columns of 'CompositePrimaryKeys' because an index has only columns // used for primary key, index key and storing columns. If you need more columns, add storing // columns or Read by primary key or Query with join. // @@ -1814,7 +1814,7 @@ func FindCompositePrimaryKeysByXY(ctx context.Context, db YORODB, x string, y st // ReadCompositePrimaryKeysByXY retrieves multiples rows from 'CompositePrimaryKeys' by KeySet as a slice. // -// This does not retrives all columns of 'CompositePrimaryKeys' because an index has only columns +// This does not retrieve all columns of 'CompositePrimaryKeys' because an index has only columns // used for primary key, index key and storing columns. If you need more columns, add storing // columns or Read by primary key or Query with join. // @@ -1887,7 +1887,7 @@ func FindFullTypeByFTString(ctx context.Context, db YORODB, fTString string) (*F // ReadFullTypeByFTString retrieves multiples rows from 'FullTypes' by KeySet as a slice. // -// This does not retrives all columns of 'FullTypes' because an index has only columns +// This does not retrieve all columns of 'FullTypes' because an index has only columns // used for primary key, index key and storing columns. If you need more columns, add storing // columns or Read by primary key or Query with join. // @@ -1970,7 +1970,7 @@ func FindFullTypesByFTIntFTTimestampNull(ctx context.Context, db YORODB, fTInt i // ReadFullTypesByFTIntFTTimestampNull retrieves multiples rows from 'FullTypes' by KeySet as a slice. // -// This does not retrives all columns of 'FullTypes' because an index has only columns +// This does not retrieve all columns of 'FullTypes' because an index has only columns // used for primary key, index key and storing columns. If you need more columns, add storing // columns or Read by primary key or Query with join. // @@ -2046,7 +2046,7 @@ func FindFullTypesByFTIntFTDate(ctx context.Context, db YORODB, fTInt int64, fTD // ReadFullTypesByFTIntFTDate retrieves multiples rows from 'FullTypes' by KeySet as a slice. // -// This does not retrives all columns of 'FullTypes' because an index has only columns +// This does not retrieve all columns of 'FullTypes' because an index has only columns // used for primary key, index key and storing columns. If you need more columns, add storing // columns or Read by primary key or Query with join. // @@ -2122,7 +2122,7 @@ func FindFullTypesByFTIntFTTimestamp(ctx context.Context, db YORODB, fTInt int64 // ReadFullTypesByFTIntFTTimestamp retrieves multiples rows from 'FullTypes' by KeySet as a slice. // -// This does not retrives all columns of 'FullTypes' because an index has only columns +// This does not retrieve all columns of 'FullTypes' because an index has only columns // used for primary key, index key and storing columns. If you need more columns, add storing // columns or Read by primary key or Query with join. // @@ -2197,7 +2197,7 @@ func FindFullTypesByFTTimestamp(ctx context.Context, db YORODB, fTTimestamp time // ReadFullTypesByFTTimestamp retrieves multiples rows from 'FullTypes' by KeySet as a slice. // -// This does not retrives all columns of 'FullTypes' because an index has only columns +// This does not retrieve all columns of 'FullTypes' because an index has only columns // used for primary key, index key and storing columns. If you need more columns, add storing // columns or Read by primary key or Query with join. // @@ -2272,7 +2272,7 @@ func FindSnakeCasesByStringIDFooBarBaz(ctx context.Context, db YORODB, stringID // ReadSnakeCasesByStringIDFooBarBaz retrieves multiples rows from 'snake_cases' by KeySet as a slice. // -// This does not retrives all columns of 'snake_cases' because an index has only columns +// This does not retrieve all columns of 'snake_cases' because an index has only columns // used for primary key, index key and storing columns. If you need more columns, add storing // columns or Read by primary key or Query with join. // diff --git a/tplbin/templates.go b/tplbin/templates.go index 9e2cb7a..e5f9e16 100644 --- a/tplbin/templates.go +++ b/tplbin/templates.go @@ -6,7 +6,7 @@ import ( "github.com/jessevdk/go-assets" ) -var _Assets35fa065605f72dabb3fd17747217ebb391a6a686 = "{{- $short := (shortname .Type.Name \"err\" \"sqlstr\" \"db\" \"q\" \"res\" \"YOLog\" .Fields) -}}\n{{- $table := (.Type.Table.TableName) -}}\n{{- if not .Index.IsUnique }}\n// Find{{ .FuncName }} retrieves multiple rows from '{{ $table }}' as a slice of {{ .Type.Name }}.\n//\n// Generated from index '{{ .Index.IndexName }}'.\nfunc Find{{ .FuncName }}(ctx context.Context, db YORODB{{ gocustomparamlist .Fields true true }}) ([]*{{ .Type.Name }}, error) {\n{{- else }}\n// Find{{ .FuncName }} retrieves a row from '{{ $table }}' as a {{ .Type.Name }}.\n//\n// If no row is present with the given key, then ReadRow returns an error where\n// spanner.ErrCode(err) is codes.NotFound.\n//\n// Generated from unique index '{{ .Index.IndexName }}'.\nfunc Find{{ .FuncName }}(ctx context.Context, db YORODB{{ gocustomparamlist .Fields true true }}) (*{{ .Type.Name }}, error) {\n{{- end }}\n\t{{- if not .NullableFields }}\n\tconst sqlstr = \"SELECT \" +\n\t\t\"{{ escapedcolnames .Type.Fields }} \" +\n\t\t\"FROM {{ $table }}@{FORCE_INDEX={{ .Index.IndexName }}} \" +\n\t\t\"WHERE {{ colnamesquery .Fields \" AND \" }}\"\n\t{{- else }}\n\tvar sqlstr = \"SELECT \" +\n\t\t\"{{ escapedcolnames .Type.Fields }} \" +\n\t\t\"FROM {{ $table }}@{FORCE_INDEX={{ .Index.IndexName }}} \"\n\n\tconds := make([]string, {{ columncount .Fields }})\n\t{{- range $i, $f := .Fields }}\n\t{{- if $f.Col.NotNull }}\n\t\tconds[{{ $i }}] = \"{{ escapedcolname $f.Col }} = @param{{ $i }}\"\n\t{{- else }}\n\tif {{ nullcheck $f }} {\n\t\tconds[{{ $i }}] = \"{{ escapedcolname $f.Col }} IS NULL\"\n\t} else {\n\t\tconds[{{ $i }}] = \"{{ escapedcolname $f.Col }} = @param{{ $i }}\"\n\t}\n\t{{- end }}\n\t{{- end }}\n\tsqlstr += \"WHERE \" + strings.Join(conds, \" AND \")\n\t{{- end }}\n\n\tstmt := spanner.NewStatement(sqlstr)\n\t{{- range $i, $f := .Fields }}\n\t\t{{- if $f.CustomType }}\n\t\t\tstmt.Params[\"param{{ $i }}\"] = {{ $f.Type }}({{ goparamname $f.Name }})\n\t\t{{- else }}\n\t\t\tstmt.Params[\"param{{ $i }}\"] = {{ goparamname $f.Name }}\n\t\t{{- end }}\n\t{{- end}}\n\n\n\tdecoder := new{{ .Type.Name }}_Decoder({{ .Type.Name }}Columns())\n\n\t// run query\n\tYOLog(ctx, sqlstr{{ goparamlist .Fields true false }})\n{{- if .Index.IsUnique }}\n\titer := db.Query(ctx, stmt)\n\tdefer iter.Stop()\n\n\trow, err := iter.Next()\n\tif err != nil {\n\t\tif err == iterator.Done {\n\t\t\treturn nil, newErrorWithCode(codes.NotFound, \"Find{{ .FuncName }}\", \"{{ $table }}\", err)\n\t\t}\n\t\treturn nil, newError(\"Find{{ .FuncName }}\", \"{{ $table }}\", err)\n\t}\n\n\t{{ $short }}, err := decoder(row)\n\tif err != nil {\n\t\treturn nil, newErrorWithCode(codes.Internal, \"Find{{ .FuncName }}\", \"{{ $table }}\", err)\n\t}\n\n\treturn {{ $short }}, nil\n{{- else }}\n\titer := db.Query(ctx, stmt)\n\tdefer iter.Stop()\n\n\t// load results\n\tres := []*{{ .Type.Name }}{}\n\tfor {\n\t\trow, err := iter.Next()\n\t\tif err != nil {\n\t\t\tif err == iterator.Done {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\treturn nil, newError(\"Find{{ .FuncName }}\", \"{{ $table }}\", err)\n\t\t}\n\n\t\t{{ $short }}, err := decoder(row)\n if err != nil {\n return nil, newErrorWithCode(codes.Internal, \"Find{{ .FuncName }}\", \"{{ $table }}\", err)\n }\n\n\t\tres = append(res, {{ $short }})\n\t}\n\n\treturn res, nil\n{{- end }}\n}\n\n\n// Read{{ .FuncName }} retrieves multiples rows from '{{ $table }}' by KeySet as a slice.\n//\n// This does not retrives all columns of '{{ $table }}' because an index has only columns\n// used for primary key, index key and storing columns. If you need more columns, add storing\n// columns or Read by primary key or Query with join.\n//\n// Generated from unique index '{{ .Index.IndexName }}'.\nfunc Read{{ .FuncName }}(ctx context.Context, db YORODB, keys spanner.KeySet) ([]*{{ .Type.Name }}, error) {\n\tvar res []*{{ .Type.Name }}\n columns := []string{\n{{- range .Type.PrimaryKeyFields }}\n\t\t\"{{ colname .Col }}\",\n{{- end }}\n{{- range .Fields }}\n\t\t\"{{ colname .Col }}\",\n{{- end }}\n{{- range .StoringFields }}\n\t\t\"{{ colname .Col }}\",\n{{- end }}\n}\n\n\tdecoder := new{{ .Type.Name }}_Decoder(columns)\n\n\trows := db.ReadUsingIndex(ctx, \"{{ $table }}\", \"{{ .Index.IndexName }}\", keys, columns)\n\terr := rows.Do(func(row *spanner.Row) error {\n\t\t{{ $short }}, err := decoder(row)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tres = append(res, {{ $short }})\n\n\t\treturn nil\n\t})\n\tif err != nil {\n\t\treturn nil, newErrorWithCode(codes.Internal, \"Read{{ .FuncName }}\", \"{{ $table }}\", err)\n\t}\n\n return res, nil\n}\n\n" +var _Assets35fa065605f72dabb3fd17747217ebb391a6a686 = "{{- $short := (shortname .Type.Name \"err\" \"sqlstr\" \"db\" \"q\" \"res\" \"YOLog\" .Fields) -}}\n{{- $table := (.Type.Table.TableName) -}}\n{{- if not .Index.IsUnique }}\n// Find{{ .FuncName }} retrieves multiple rows from '{{ $table }}' as a slice of {{ .Type.Name }}.\n//\n// Generated from index '{{ .Index.IndexName }}'.\nfunc Find{{ .FuncName }}(ctx context.Context, db YORODB{{ gocustomparamlist .Fields true true }}) ([]*{{ .Type.Name }}, error) {\n{{- else }}\n// Find{{ .FuncName }} retrieves a row from '{{ $table }}' as a {{ .Type.Name }}.\n//\n// If no row is present with the given key, then ReadRow returns an error where\n// spanner.ErrCode(err) is codes.NotFound.\n//\n// Generated from unique index '{{ .Index.IndexName }}'.\nfunc Find{{ .FuncName }}(ctx context.Context, db YORODB{{ gocustomparamlist .Fields true true }}) (*{{ .Type.Name }}, error) {\n{{- end }}\n\t{{- if not .NullableFields }}\n\tconst sqlstr = \"SELECT \" +\n\t\t\"{{ escapedcolnames .Type.Fields }} \" +\n\t\t\"FROM {{ $table }}@{FORCE_INDEX={{ .Index.IndexName }}} \" +\n\t\t\"WHERE {{ colnamesquery .Fields \" AND \" }}\"\n\t{{- else }}\n\tvar sqlstr = \"SELECT \" +\n\t\t\"{{ escapedcolnames .Type.Fields }} \" +\n\t\t\"FROM {{ $table }}@{FORCE_INDEX={{ .Index.IndexName }}} \"\n\n\tconds := make([]string, {{ columncount .Fields }})\n\t{{- range $i, $f := .Fields }}\n\t{{- if $f.Col.NotNull }}\n\t\tconds[{{ $i }}] = \"{{ escapedcolname $f.Col }} = @param{{ $i }}\"\n\t{{- else }}\n\tif {{ nullcheck $f }} {\n\t\tconds[{{ $i }}] = \"{{ escapedcolname $f.Col }} IS NULL\"\n\t} else {\n\t\tconds[{{ $i }}] = \"{{ escapedcolname $f.Col }} = @param{{ $i }}\"\n\t}\n\t{{- end }}\n\t{{- end }}\n\tsqlstr += \"WHERE \" + strings.Join(conds, \" AND \")\n\t{{- end }}\n\n\tstmt := spanner.NewStatement(sqlstr)\n\t{{- range $i, $f := .Fields }}\n\t\t{{- if $f.CustomType }}\n\t\t\tstmt.Params[\"param{{ $i }}\"] = {{ $f.Type }}({{ goparamname $f.Name }})\n\t\t{{- else }}\n\t\t\tstmt.Params[\"param{{ $i }}\"] = {{ goparamname $f.Name }}\n\t\t{{- end }}\n\t{{- end}}\n\n\n\tdecoder := new{{ .Type.Name }}_Decoder({{ .Type.Name }}Columns())\n\n\t// run query\n\tYOLog(ctx, sqlstr{{ goparamlist .Fields true false }})\n{{- if .Index.IsUnique }}\n\titer := db.Query(ctx, stmt)\n\tdefer iter.Stop()\n\n\trow, err := iter.Next()\n\tif err != nil {\n\t\tif err == iterator.Done {\n\t\t\treturn nil, newErrorWithCode(codes.NotFound, \"Find{{ .FuncName }}\", \"{{ $table }}\", err)\n\t\t}\n\t\treturn nil, newError(\"Find{{ .FuncName }}\", \"{{ $table }}\", err)\n\t}\n\n\t{{ $short }}, err := decoder(row)\n\tif err != nil {\n\t\treturn nil, newErrorWithCode(codes.Internal, \"Find{{ .FuncName }}\", \"{{ $table }}\", err)\n\t}\n\n\treturn {{ $short }}, nil\n{{- else }}\n\titer := db.Query(ctx, stmt)\n\tdefer iter.Stop()\n\n\t// load results\n\tres := []*{{ .Type.Name }}{}\n\tfor {\n\t\trow, err := iter.Next()\n\t\tif err != nil {\n\t\t\tif err == iterator.Done {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\treturn nil, newError(\"Find{{ .FuncName }}\", \"{{ $table }}\", err)\n\t\t}\n\n\t\t{{ $short }}, err := decoder(row)\n if err != nil {\n return nil, newErrorWithCode(codes.Internal, \"Find{{ .FuncName }}\", \"{{ $table }}\", err)\n }\n\n\t\tres = append(res, {{ $short }})\n\t}\n\n\treturn res, nil\n{{- end }}\n}\n\n\n// Read{{ .FuncName }} retrieves multiples rows from '{{ $table }}' by KeySet as a slice.\n//\n// This does not retrieve all columns of '{{ $table }}' because an index has only columns\n// used for primary key, index key and storing columns. If you need more columns, add storing\n// columns or Read by primary key or Query with join.\n//\n// Generated from unique index '{{ .Index.IndexName }}'.\nfunc Read{{ .FuncName }}(ctx context.Context, db YORODB, keys spanner.KeySet) ([]*{{ .Type.Name }}, error) {\n\tvar res []*{{ .Type.Name }}\n columns := []string{\n{{- range .Type.PrimaryKeyFields }}\n\t\t\"{{ colname .Col }}\",\n{{- end }}\n{{- range .Fields }}\n\t\t\"{{ colname .Col }}\",\n{{- end }}\n{{- range .StoringFields }}\n\t\t\"{{ colname .Col }}\",\n{{- end }}\n}\n\n\tdecoder := new{{ .Type.Name }}_Decoder(columns)\n\n\trows := db.ReadUsingIndex(ctx, \"{{ $table }}\", \"{{ .Index.IndexName }}\", keys, columns)\n\terr := rows.Do(func(row *spanner.Row) error {\n\t\t{{ $short }}, err := decoder(row)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tres = append(res, {{ $short }})\n\n\t\treturn nil\n\t})\n\tif err != nil {\n\t\treturn nil, newErrorWithCode(codes.Internal, \"Read{{ .FuncName }}\", \"{{ $table }}\", err)\n\t}\n\n return res, nil\n}\n\n" var _Assets7fd73945d69f17ee7478fe75c9ebb3a425327b99 = "{{- $short := (shortname .Name \"err\" \"res\" \"sqlstr\" \"db\" \"YOLog\") -}}\n{{- $table := (.Table.TableName) -}}\n// {{ .Name }} represents a row from '{{ $table }}'.\ntype {{ .Name }} struct {\n{{- range .Fields }}\n{{- if eq (.Col.DataType) (.Col.ColumnName) }}\n\t{{ .Name }} string `spanner:\"{{ .Col.ColumnName }}\" json:\"{{ .Col.ColumnName }}\"` // {{ .Col.ColumnName }} enum\n{{- else if .CustomType }}\n\t{{ .Name }} {{ retype .CustomType }} `spanner:\"{{ .Col.ColumnName }}\" json:\"{{ .Col.ColumnName }}\"` // {{ .Col.ColumnName }}\n{{- else }}\n\t{{ .Name }} {{ .Type }} `spanner:\"{{ .Col.ColumnName }}\" json:\"{{ .Col.ColumnName }}\"` // {{ .Col.ColumnName }}\n{{- end }}\n{{- end }}\n}\n\n{{ if .PrimaryKey }}\nfunc {{ .Name }}PrimaryKeys() []string {\n return []string{\n{{- range .PrimaryKeyFields }}\n\t\t\"{{ colname .Col }}\",\n{{- end }}\n\t}\n}\n{{- end }}\n\nfunc {{ .Name }}Columns() []string {\n\treturn []string{\n{{- range .Fields }}\n\t\t\"{{ colname .Col }}\",\n{{- end }}\n\t}\n}\n\nfunc {{ .Name }}WritableColumns() []string {\n\treturn []string{\n{{- range .Fields }}\n\t{{- if not .Col.IsGenerated }}\n\t\t\"{{ colname .Col }}\",\n\t{{- end }}\n{{- end }}\n\t}\n}\n\nfunc ({{ $short }} *{{ .Name }}) columnsToPtrs(cols []string, customPtrs map[string]interface{}) ([]interface{}, error) {\n\tret := make([]interface{}, 0, len(cols))\n\tfor _, col := range cols {\n\t\tif val, ok := customPtrs[col]; ok {\n\t\t\tret = append(ret, val)\n\t\t\tcontinue\n\t\t}\n\n\t\tswitch col {\n{{- range .Fields }}\n\t\tcase \"{{ colname .Col }}\":\n\t\t\tret = append(ret, &{{ $short }}.{{ .Name }})\n{{- end }}\n\t\tdefault:\n\t\t\treturn nil, fmt.Errorf(\"unknown column: %s\", col)\n\t\t}\n\t}\n\treturn ret, nil\n}\n\nfunc ({{ $short }} *{{ .Name }}) columnsToValues(cols []string) ([]interface{}, error) {\n\tret := make([]interface{}, 0, len(cols))\n\tfor _, col := range cols {\n\t\tswitch col {\n{{- range .Fields }}\n\t\tcase \"{{ colname .Col }}\":\n\t\t\t{{- if .CustomType }}\n\t\t\tret = append(ret, {{ .Type }}({{ $short }}.{{ .Name }}))\n\t\t\t{{- else }}\n\t\t\tret = append(ret, {{ $short }}.{{ .Name }})\n\t\t\t{{- end }}\n{{- end }}\n\t\tdefault:\n\t\t\treturn nil, fmt.Errorf(\"unknown column: %s\", col)\n\t\t}\n\t}\n\n\treturn ret, nil\n}\n\n// new{{ .Name }}_Decoder returns a decoder which reads a row from *spanner.Row\n// into {{ .Name }}. The decoder is not goroutine-safe. Don't use it concurrently.\nfunc new{{ .Name }}_Decoder(cols []string) func(*spanner.Row) (*{{ .Name }}, error) {\n\t{{- range .Fields }}\n\t\t{{- if .CustomType }}\n\t\t\tvar {{ customtypeparam .Name }} {{ .Type }}\n\t\t{{- end }}\n\t{{- end }}\n\tcustomPtrs := map[string]interface{}{\n\t\t{{- range .Fields }}\n\t\t\t{{- if .CustomType }}\n\t\t\t\t\"{{ colname .Col }}\": &{{ customtypeparam .Name }},\n\t\t\t{{- end }}\n\t{{- end }}\n\t}\n\n\treturn func(row *spanner.Row) (*{{ .Name }}, error) {\n var {{ $short }} {{ .Name }}\n ptrs, err := {{ $short }}.columnsToPtrs(cols, customPtrs)\n if err != nil {\n return nil, err\n }\n\n if err := row.Columns(ptrs...); err != nil {\n return nil, err\n }\n {{- range .Fields }}\n {{- if .CustomType }}\n {{ $short }}.{{ .Name }} = {{ retype .CustomType }}({{ customtypeparam .Name }})\n {{- end }}\n {{- end }}\n\n\n\t\treturn &{{ $short }}, nil\n\t}\n}\n\n// Insert returns a Mutation to insert a row into a table. If the row already\n// exists, the write or transaction fails.\nfunc ({{ $short }} *{{ .Name }}) Insert(ctx context.Context) *spanner.Mutation {\n\tvalues, _ := {{ $short }}.columnsToValues({{ .Name }}WritableColumns())\n\treturn spanner.Insert(\"{{ $table }}\", {{ .Name }}WritableColumns(), values)\n}\n\n{{ if ne (fieldnames .Fields $short .PrimaryKeyFields) \"\" }}\n// Update returns a Mutation to update a row in a table. If the row does not\n// already exist, the write or transaction fails.\nfunc ({{ $short }} *{{ .Name }}) Update(ctx context.Context) *spanner.Mutation {\n\tvalues, _ := {{ $short }}.columnsToValues({{ .Name }}WritableColumns())\n\treturn spanner.Update(\"{{ $table }}\", {{ .Name }}WritableColumns(), values)\n}\n\n// InsertOrUpdate returns a Mutation to insert a row into a table. If the row\n// already exists, it updates it instead. Any column values not explicitly\n// written are preserved.\nfunc ({{ $short }} *{{ .Name }}) InsertOrUpdate(ctx context.Context) *spanner.Mutation {\n\tvalues, _ := {{ $short }}.columnsToValues({{ .Name }}WritableColumns())\n\treturn spanner.InsertOrUpdate(\"{{ $table }}\", {{ .Name }}WritableColumns(), values)\n}\n\n// UpdateColumns returns a Mutation to update specified columns of a row in a table.\nfunc ({{ $short }} *{{ .Name }}) UpdateColumns(ctx context.Context, cols ...string) (*spanner.Mutation, error) {\n\t// add primary keys to columns to update by primary keys\n\tcolsWithPKeys := append(cols, {{ .Name }}PrimaryKeys()...)\n\n\tvalues, err := {{ $short }}.columnsToValues(colsWithPKeys)\n\tif err != nil {\n\t\treturn nil, newErrorWithCode(codes.InvalidArgument, \"{{ .Name }}.UpdateColumns\", \"{{ $table }}\", err)\n\t}\n\n\treturn spanner.Update(\"{{ $table }}\", colsWithPKeys, values), nil\n}\n\n// Find{{ .Name }} gets a {{ .Name }} by primary key\nfunc Find{{ .Name }}(ctx context.Context, db YORODB{{ gocustomparamlist .PrimaryKeyFields true true }}) (*{{ .Name }}, error) {\n\tkey := spanner.Key{ {{ gocustomparamlist .PrimaryKeyFields false false }} }\n\trow, err := db.ReadRow(ctx, \"{{ $table }}\", key, {{ .Name }}Columns())\n\tif err != nil {\n\t\treturn nil, newError(\"Find{{ .Name }}\", \"{{ $table }}\", err)\n\t}\n\n\tdecoder := new{{ .Name }}_Decoder({{ .Name}}Columns())\n\t{{ $short }}, err := decoder(row)\n\tif err != nil {\n\t\treturn nil, newErrorWithCode(codes.Internal, \"Find{{ .Name }}\", \"{{ $table }}\", err)\n\t}\n\n\treturn {{ $short }}, nil\n}\n\n// Read{{ .Name }} retrieves multiples rows from {{ .Name }} by KeySet as a slice.\nfunc Read{{ .Name }}(ctx context.Context, db YORODB, keys spanner.KeySet) ([]*{{ .Name }}, error) {\n\tvar res []*{{ .Name }}\n\n\tdecoder := new{{ .Name }}_Decoder({{ .Name}}Columns())\n\n\trows := db.Read(ctx, \"{{ $table }}\", keys, {{ .Name }}Columns())\n\terr := rows.Do(func(row *spanner.Row) error {\n\t\t{{ $short }}, err := decoder(row)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tres = append(res, {{ $short }})\n\n\t\treturn nil\n\t})\n\tif err != nil {\n\t\treturn nil, newErrorWithCode(codes.Internal, \"Read{{ .Name }}\", \"{{ $table }}\", err)\n\t}\n\n\treturn res, nil\n}\n{{ end }}\n\n// Delete deletes the {{ .Name }} from the database.\nfunc ({{ $short }} *{{ .Name }}) Delete(ctx context.Context) *spanner.Mutation {\n\tvalues, _ := {{ $short }}.columnsToValues({{ .Name }}PrimaryKeys())\n\treturn spanner.Delete(\"{{ $table }}\", spanner.Key(values))\n}\n" var _Assets652b6e36fe11372d65bfc0531de888fa9f12e2c0 = "// YODB is the common interface for database operations.\ntype YODB interface {\n\tYORODB\n}\n\n// YORODB is the common interface for database operations.\ntype YORODB interface {\n\tReadRow(ctx context.Context, table string, key spanner.Key, columns []string) (*spanner.Row, error)\n\tRead(ctx context.Context, table string, keys spanner.KeySet, columns []string) *spanner.RowIterator\n\tReadUsingIndex(ctx context.Context, table, index string, keys spanner.KeySet, columns []string) (ri *spanner.RowIterator)\n\tQuery(ctx context.Context, statement spanner.Statement) *spanner.RowIterator\n}\n\n// YOLog provides the log func used by generated queries.\nvar YOLog = func(context.Context, string, ...interface{}) { }\n\nfunc newError(method, table string, err error) error {\n\tcode := spanner.ErrCode(err)\n\treturn newErrorWithCode(code, method, table, err)\n}\n\nfunc newErrorWithCode(code codes.Code, method, table string, err error) error {\n\treturn &yoError{\n\t\tmethod: method,\n\t\ttable: table,\n\t\terr: err,\n\t\tcode: code,\n\t}\n}\n\ntype yoError struct {\n\terr error\n\tmethod string\n\ttable string\n\tcode codes.Code\n}\n\nfunc (e yoError) Error() string {\n\treturn fmt.Sprintf(\"yo error in %s(%s): %v\", e.method, e.table, e.err)\n}\n\nfunc (e yoError) Unwrap() error {\n\treturn e.err\n}\n\nfunc (e yoError) DBTableName() string {\n\treturn e.table\n}\n\n// GRPCStatus implements a conversion to a gRPC status using `status.Convert(error)`.\n// If the error is originated from the Spanner library, this returns a gRPC status of\n// the original error. It may contain details of the status such as RetryInfo.\nfunc (e yoError) GRPCStatus() *status.Status {\n\tvar ae *apierror.APIError\n\tif errors.As(e.err, &ae) {\n\t\treturn status.Convert(ae)\n\t}\n\n\treturn status.New(e.code, e.Error())\n}\n\nfunc (e yoError) Timeout() bool { return e.code == codes.DeadlineExceeded }\nfunc (e yoError) Temporary() bool { return e.code == codes.DeadlineExceeded }\nfunc (e yoError) NotFound() bool { return e.code == codes.NotFound }\n" var _Assets2da36312f867e2e1a26f5a29c883fe2d56891890 = "// Code generated by yo. DO NOT EDIT.\n// Package {{ .Package }} contains the types.\npackage {{ .Package }}\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\n\t\"cloud.google.com/go/spanner\"\n\t\"google.golang.org/api/iterator\"\n\t\"google.golang.org/grpc/codes\"\n\t\"google.golang.org/grpc/status\"\n)\n" diff --git a/v2/module/builtin/templates/index.go.tpl b/v2/module/builtin/templates/index.go.tpl index 2f1618a..378184b 100644 --- a/v2/module/builtin/templates/index.go.tpl +++ b/v2/module/builtin/templates/index.go.tpl @@ -99,7 +99,7 @@ func Find{{ .FuncName }}(ctx context.Context, db YODB{{ goParams .Fields true tr // Read{{ .FuncName }} retrieves multiples rows from '{{ $table }}' by KeySet as a slice. // -// This does not retrives all columns of '{{ $table }}' because an index has only columns +// This does not retrieve all columns of '{{ $table }}' because an index has only columns // used for primary key, index key and storing columns. If you need more columns, add storing // columns or Read by primary key or Query with join. // diff --git a/v2/module/builtin/templates/legacy_index.go.tpl b/v2/module/builtin/templates/legacy_index.go.tpl index d9966b2..05f47ae 100644 --- a/v2/module/builtin/templates/legacy_index.go.tpl +++ b/v2/module/builtin/templates/legacy_index.go.tpl @@ -99,7 +99,7 @@ func Find{{ .LegacyFuncName }}(ctx context.Context, db YODB{{ goParams .Fields t // Read{{ .LegacyFuncName }} retrieves multiples rows from '{{ $table }}' by KeySet as a slice. // -// This does not retrives all columns of '{{ $table }}' because an index has only columns +// This does not retrieve all columns of '{{ $table }}' because an index has only columns // used for primary key, index key and storing columns. If you need more columns, add storing // columns or Read by primary key or Query with join. // diff --git a/v2/test/testmodels/default/composite_primary_key.yo.go b/v2/test/testmodels/default/composite_primary_key.yo.go index 74333b0..6b046f9 100644 --- a/v2/test/testmodels/default/composite_primary_key.yo.go +++ b/v2/test/testmodels/default/composite_primary_key.yo.go @@ -255,7 +255,7 @@ func FindCompositePrimaryKeysByCompositePrimaryKeysByError(ctx context.Context, // ReadCompositePrimaryKeysByCompositePrimaryKeysByError retrieves multiples rows from 'CompositePrimaryKeys' by KeySet as a slice. // -// This does not retrives all columns of 'CompositePrimaryKeys' because an index has only columns +// This does not retrieve all columns of 'CompositePrimaryKeys' because an index has only columns // used for primary key, index key and storing columns. If you need more columns, add storing // columns or Read by primary key or Query with join. // @@ -330,7 +330,7 @@ func FindCompositePrimaryKeysByCompositePrimaryKeysByError2(ctx context.Context, // ReadCompositePrimaryKeysByCompositePrimaryKeysByError2 retrieves multiples rows from 'CompositePrimaryKeys' by KeySet as a slice. // -// This does not retrives all columns of 'CompositePrimaryKeys' because an index has only columns +// This does not retrieve all columns of 'CompositePrimaryKeys' because an index has only columns // used for primary key, index key and storing columns. If you need more columns, add storing // columns or Read by primary key or Query with join. // @@ -406,7 +406,7 @@ func FindCompositePrimaryKeysByCompositePrimaryKeysByError3(ctx context.Context, // ReadCompositePrimaryKeysByCompositePrimaryKeysByError3 retrieves multiples rows from 'CompositePrimaryKeys' by KeySet as a slice. // -// This does not retrives all columns of 'CompositePrimaryKeys' because an index has only columns +// This does not retrieve all columns of 'CompositePrimaryKeys' because an index has only columns // used for primary key, index key and storing columns. If you need more columns, add storing // columns or Read by primary key or Query with join. // @@ -484,7 +484,7 @@ func FindCompositePrimaryKeysByCompositePrimaryKeysByXY(ctx context.Context, db // ReadCompositePrimaryKeysByCompositePrimaryKeysByXY retrieves multiples rows from 'CompositePrimaryKeys' by KeySet as a slice. // -// This does not retrives all columns of 'CompositePrimaryKeys' because an index has only columns +// This does not retrieve all columns of 'CompositePrimaryKeys' because an index has only columns // used for primary key, index key and storing columns. If you need more columns, add storing // columns or Read by primary key or Query with join. // diff --git a/v2/test/testmodels/default/custom_composite_primary_key.yo.go b/v2/test/testmodels/default/custom_composite_primary_key.yo.go index c51ba3b..4e6ec3e 100644 --- a/v2/test/testmodels/default/custom_composite_primary_key.yo.go +++ b/v2/test/testmodels/default/custom_composite_primary_key.yo.go @@ -255,7 +255,7 @@ func FindCustomCompositePrimaryKeysByCustomCompositePrimaryKeysByError(ctx conte // ReadCustomCompositePrimaryKeysByCustomCompositePrimaryKeysByError retrieves multiples rows from 'CustomCompositePrimaryKeys' by KeySet as a slice. // -// This does not retrives all columns of 'CustomCompositePrimaryKeys' because an index has only columns +// This does not retrieve all columns of 'CustomCompositePrimaryKeys' because an index has only columns // used for primary key, index key and storing columns. If you need more columns, add storing // columns or Read by primary key or Query with join. // @@ -330,7 +330,7 @@ func FindCustomCompositePrimaryKeysByCustomCompositePrimaryKeysByError2(ctx cont // ReadCustomCompositePrimaryKeysByCustomCompositePrimaryKeysByError2 retrieves multiples rows from 'CustomCompositePrimaryKeys' by KeySet as a slice. // -// This does not retrives all columns of 'CustomCompositePrimaryKeys' because an index has only columns +// This does not retrieve all columns of 'CustomCompositePrimaryKeys' because an index has only columns // used for primary key, index key and storing columns. If you need more columns, add storing // columns or Read by primary key or Query with join. // @@ -406,7 +406,7 @@ func FindCustomCompositePrimaryKeysByCustomCompositePrimaryKeysByError3(ctx cont // ReadCustomCompositePrimaryKeysByCustomCompositePrimaryKeysByError3 retrieves multiples rows from 'CustomCompositePrimaryKeys' by KeySet as a slice. // -// This does not retrives all columns of 'CustomCompositePrimaryKeys' because an index has only columns +// This does not retrieve all columns of 'CustomCompositePrimaryKeys' because an index has only columns // used for primary key, index key and storing columns. If you need more columns, add storing // columns or Read by primary key or Query with join. // @@ -484,7 +484,7 @@ func FindCustomCompositePrimaryKeysByCustomCompositePrimaryKeysByXY(ctx context. // ReadCustomCompositePrimaryKeysByCustomCompositePrimaryKeysByXY retrieves multiples rows from 'CustomCompositePrimaryKeys' by KeySet as a slice. // -// This does not retrives all columns of 'CustomCompositePrimaryKeys' because an index has only columns +// This does not retrieve all columns of 'CustomCompositePrimaryKeys' because an index has only columns // used for primary key, index key and storing columns. If you need more columns, add storing // columns or Read by primary key or Query with join. // diff --git a/v2/test/testmodels/default/full_type.yo.go b/v2/test/testmodels/default/full_type.yo.go index 58d80cc..7656401 100644 --- a/v2/test/testmodels/default/full_type.yo.go +++ b/v2/test/testmodels/default/full_type.yo.go @@ -436,7 +436,7 @@ func FindFullTypeByFullTypesByFTString(ctx context.Context, db YODB, fTString st // ReadFullTypeByFullTypesByFTString retrieves multiples rows from 'FullTypes' by KeySet as a slice. // -// This does not retrives all columns of 'FullTypes' because an index has only columns +// This does not retrieve all columns of 'FullTypes' because an index has only columns // used for primary key, index key and storing columns. If you need more columns, add storing // columns or Read by primary key or Query with join. // @@ -519,7 +519,7 @@ func FindFullTypesByFullTypesByInTimestampNull(ctx context.Context, db YODB, fTI // ReadFullTypesByFullTypesByInTimestampNull retrieves multiples rows from 'FullTypes' by KeySet as a slice. // -// This does not retrives all columns of 'FullTypes' because an index has only columns +// This does not retrieve all columns of 'FullTypes' because an index has only columns // used for primary key, index key and storing columns. If you need more columns, add storing // columns or Read by primary key or Query with join. // @@ -595,7 +595,7 @@ func FindFullTypesByFullTypesByIntDate(ctx context.Context, db YODB, fTInt int64 // ReadFullTypesByFullTypesByIntDate retrieves multiples rows from 'FullTypes' by KeySet as a slice. // -// This does not retrives all columns of 'FullTypes' because an index has only columns +// This does not retrieve all columns of 'FullTypes' because an index has only columns // used for primary key, index key and storing columns. If you need more columns, add storing // columns or Read by primary key or Query with join. // @@ -671,7 +671,7 @@ func FindFullTypesByFullTypesByIntTimestamp(ctx context.Context, db YODB, fTInt // ReadFullTypesByFullTypesByIntTimestamp retrieves multiples rows from 'FullTypes' by KeySet as a slice. // -// This does not retrives all columns of 'FullTypes' because an index has only columns +// This does not retrieve all columns of 'FullTypes' because an index has only columns // used for primary key, index key and storing columns. If you need more columns, add storing // columns or Read by primary key or Query with join. // @@ -746,7 +746,7 @@ func FindFullTypesByFullTypesByTimestamp(ctx context.Context, db YODB, fTTimesta // ReadFullTypesByFullTypesByTimestamp retrieves multiples rows from 'FullTypes' by KeySet as a slice. // -// This does not retrives all columns of 'FullTypes' because an index has only columns +// This does not retrieve all columns of 'FullTypes' because an index has only columns // used for primary key, index key and storing columns. If you need more columns, add storing // columns or Read by primary key or Query with join. // diff --git a/v2/test/testmodels/default/snake_case.yo.go b/v2/test/testmodels/default/snake_case.yo.go index 1fd26b8..2637030 100644 --- a/v2/test/testmodels/default/snake_case.yo.go +++ b/v2/test/testmodels/default/snake_case.yo.go @@ -227,7 +227,7 @@ func FindSnakeCasesBySnakeCasesByStringID(ctx context.Context, db YODB, stringID // ReadSnakeCasesBySnakeCasesByStringID retrieves multiples rows from 'snake_cases' by KeySet as a slice. // -// This does not retrives all columns of 'snake_cases' because an index has only columns +// This does not retrieve all columns of 'snake_cases' because an index has only columns // used for primary key, index key and storing columns. If you need more columns, add storing // columns or Read by primary key or Query with join. // diff --git a/v2/test/testmodels/legacy_default/composite_primary_key.yo.go b/v2/test/testmodels/legacy_default/composite_primary_key.yo.go index f799cad..b5b825b 100644 --- a/v2/test/testmodels/legacy_default/composite_primary_key.yo.go +++ b/v2/test/testmodels/legacy_default/composite_primary_key.yo.go @@ -255,7 +255,7 @@ func FindCompositePrimaryKeysByError(ctx context.Context, db YODB, e int64) ([]* // ReadCompositePrimaryKeysByError retrieves multiples rows from 'CompositePrimaryKeys' by KeySet as a slice. // -// This does not retrives all columns of 'CompositePrimaryKeys' because an index has only columns +// This does not retrieve all columns of 'CompositePrimaryKeys' because an index has only columns // used for primary key, index key and storing columns. If you need more columns, add storing // columns or Read by primary key or Query with join. // @@ -330,7 +330,7 @@ func FindCompositePrimaryKeysByZError(ctx context.Context, db YODB, e int64) ([] // ReadCompositePrimaryKeysByZError retrieves multiples rows from 'CompositePrimaryKeys' by KeySet as a slice. // -// This does not retrives all columns of 'CompositePrimaryKeys' because an index has only columns +// This does not retrieve all columns of 'CompositePrimaryKeys' because an index has only columns // used for primary key, index key and storing columns. If you need more columns, add storing // columns or Read by primary key or Query with join. // @@ -406,7 +406,7 @@ func FindCompositePrimaryKeysByZYError(ctx context.Context, db YODB, e int64) ([ // ReadCompositePrimaryKeysByZYError retrieves multiples rows from 'CompositePrimaryKeys' by KeySet as a slice. // -// This does not retrives all columns of 'CompositePrimaryKeys' because an index has only columns +// This does not retrieve all columns of 'CompositePrimaryKeys' because an index has only columns // used for primary key, index key and storing columns. If you need more columns, add storing // columns or Read by primary key or Query with join. // @@ -484,7 +484,7 @@ func FindCompositePrimaryKeysByXY(ctx context.Context, db YODB, x string, y stri // ReadCompositePrimaryKeysByXY retrieves multiples rows from 'CompositePrimaryKeys' by KeySet as a slice. // -// This does not retrives all columns of 'CompositePrimaryKeys' because an index has only columns +// This does not retrieve all columns of 'CompositePrimaryKeys' because an index has only columns // used for primary key, index key and storing columns. If you need more columns, add storing // columns or Read by primary key or Query with join. // diff --git a/v2/test/testmodels/legacy_default/custom_composite_primary_key.yo.go b/v2/test/testmodels/legacy_default/custom_composite_primary_key.yo.go index 39948ab..b900a6c 100644 --- a/v2/test/testmodels/legacy_default/custom_composite_primary_key.yo.go +++ b/v2/test/testmodels/legacy_default/custom_composite_primary_key.yo.go @@ -255,7 +255,7 @@ func FindCustomCompositePrimaryKeysByError(ctx context.Context, db YODB, e int8) // ReadCustomCompositePrimaryKeysByError retrieves multiples rows from 'CustomCompositePrimaryKeys' by KeySet as a slice. // -// This does not retrives all columns of 'CustomCompositePrimaryKeys' because an index has only columns +// This does not retrieve all columns of 'CustomCompositePrimaryKeys' because an index has only columns // used for primary key, index key and storing columns. If you need more columns, add storing // columns or Read by primary key or Query with join. // @@ -330,7 +330,7 @@ func FindCustomCompositePrimaryKeysByZError(ctx context.Context, db YODB, e int8 // ReadCustomCompositePrimaryKeysByZError retrieves multiples rows from 'CustomCompositePrimaryKeys' by KeySet as a slice. // -// This does not retrives all columns of 'CustomCompositePrimaryKeys' because an index has only columns +// This does not retrieve all columns of 'CustomCompositePrimaryKeys' because an index has only columns // used for primary key, index key and storing columns. If you need more columns, add storing // columns or Read by primary key or Query with join. // @@ -406,7 +406,7 @@ func FindCustomCompositePrimaryKeysByZYError(ctx context.Context, db YODB, e int // ReadCustomCompositePrimaryKeysByZYError retrieves multiples rows from 'CustomCompositePrimaryKeys' by KeySet as a slice. // -// This does not retrives all columns of 'CustomCompositePrimaryKeys' because an index has only columns +// This does not retrieve all columns of 'CustomCompositePrimaryKeys' because an index has only columns // used for primary key, index key and storing columns. If you need more columns, add storing // columns or Read by primary key or Query with join. // @@ -484,7 +484,7 @@ func FindCustomCompositePrimaryKeysByXY(ctx context.Context, db YODB, x string, // ReadCustomCompositePrimaryKeysByXY retrieves multiples rows from 'CustomCompositePrimaryKeys' by KeySet as a slice. // -// This does not retrives all columns of 'CustomCompositePrimaryKeys' because an index has only columns +// This does not retrieve all columns of 'CustomCompositePrimaryKeys' because an index has only columns // used for primary key, index key and storing columns. If you need more columns, add storing // columns or Read by primary key or Query with join. // diff --git a/v2/test/testmodels/legacy_default/full_type.yo.go b/v2/test/testmodels/legacy_default/full_type.yo.go index 8c9d81c..b6663ab 100644 --- a/v2/test/testmodels/legacy_default/full_type.yo.go +++ b/v2/test/testmodels/legacy_default/full_type.yo.go @@ -436,7 +436,7 @@ func FindFullTypeByFTString(ctx context.Context, db YODB, fTString string) (*Ful // ReadFullTypeByFTString retrieves multiples rows from 'FullTypes' by KeySet as a slice. // -// This does not retrives all columns of 'FullTypes' because an index has only columns +// This does not retrieve all columns of 'FullTypes' because an index has only columns // used for primary key, index key and storing columns. If you need more columns, add storing // columns or Read by primary key or Query with join. // @@ -519,7 +519,7 @@ func FindFullTypesByFTIntFTTimestampNull(ctx context.Context, db YODB, fTInt int // ReadFullTypesByFTIntFTTimestampNull retrieves multiples rows from 'FullTypes' by KeySet as a slice. // -// This does not retrives all columns of 'FullTypes' because an index has only columns +// This does not retrieve all columns of 'FullTypes' because an index has only columns // used for primary key, index key and storing columns. If you need more columns, add storing // columns or Read by primary key or Query with join. // @@ -595,7 +595,7 @@ func FindFullTypesByFTIntFTDate(ctx context.Context, db YODB, fTInt int64, fTDat // ReadFullTypesByFTIntFTDate retrieves multiples rows from 'FullTypes' by KeySet as a slice. // -// This does not retrives all columns of 'FullTypes' because an index has only columns +// This does not retrieve all columns of 'FullTypes' because an index has only columns // used for primary key, index key and storing columns. If you need more columns, add storing // columns or Read by primary key or Query with join. // @@ -671,7 +671,7 @@ func FindFullTypesByFTIntFTTimestamp(ctx context.Context, db YODB, fTInt int64, // ReadFullTypesByFTIntFTTimestamp retrieves multiples rows from 'FullTypes' by KeySet as a slice. // -// This does not retrives all columns of 'FullTypes' because an index has only columns +// This does not retrieve all columns of 'FullTypes' because an index has only columns // used for primary key, index key and storing columns. If you need more columns, add storing // columns or Read by primary key or Query with join. // @@ -746,7 +746,7 @@ func FindFullTypesByFTTimestamp(ctx context.Context, db YODB, fTTimestamp time.T // ReadFullTypesByFTTimestamp retrieves multiples rows from 'FullTypes' by KeySet as a slice. // -// This does not retrives all columns of 'FullTypes' because an index has only columns +// This does not retrieve all columns of 'FullTypes' because an index has only columns // used for primary key, index key and storing columns. If you need more columns, add storing // columns or Read by primary key or Query with join. // diff --git a/v2/test/testmodels/legacy_default/snake_case.yo.go b/v2/test/testmodels/legacy_default/snake_case.yo.go index ac76ac1..55e714c 100644 --- a/v2/test/testmodels/legacy_default/snake_case.yo.go +++ b/v2/test/testmodels/legacy_default/snake_case.yo.go @@ -227,7 +227,7 @@ func FindSnakeCasesByStringIDFooBarBaz(ctx context.Context, db YODB, stringID st // ReadSnakeCasesByStringIDFooBarBaz retrieves multiples rows from 'snake_cases' by KeySet as a slice. // -// This does not retrives all columns of 'snake_cases' because an index has only columns +// This does not retrieve all columns of 'snake_cases' because an index has only columns // used for primary key, index key and storing columns. If you need more columns, add storing // columns or Read by primary key or Query with join. //