Skip to content

May I kindly ask you to support View? #95

Description

@dulao5

Objective

I want to aggregate the results of a Table Join with a view and process the query results using newHoge_Decoder.

Problem

The comment in internal.TypeLoader.LoadTable says "LoadTable loads a schema table/view definition."

yo/internal/loader.go

Lines 88 to 89 in f04de87

// LoadTable loads a schema table/view definition.
func (tl *TypeLoader) LoadTable(args *ArgType) (map[string]*Type, error) {

But actually when processing a View, I get the following error.

panic: runtime error: index out of range [0] with length 0

goroutine 1 [running]:
go.mercari.io/yo/internal.(*TypeLoader).loadPrimaryKeys(0xc0001c1890?, 0xc000916200)
	go/1.18.1/pkg/mod/go.mercari.io/yo@v0.5.2/internal/loader.go:179 +0x212
go.mercari.io/yo/internal.(*TypeLoader).LoadTable(0xc0001c1890, 0x1ecc660)
	go/1.18.1/pkg/mod/go.mercari.io/yo@v0.5.2/internal/loader.go:133 +0x1a5
go.mercari.io/yo/internal.(*TypeLoader).LoadSchema(0x0?, 0xc00034b220?)
	go/1.18.1/pkg/mod/go.mercari.io/yo@v0.5.2/internal/loader.go:72 +0x27
go.mercari.io/yo/cmd.glob..func5(0x1ebeec0?, {0xc00034b220?, 0x5?, 0x5?})
	go/1.18.1/pkg/mod/go.mercari.io/yo@v0.5.2/cmd/root.go:83 +0x21f
github.com/spf13/cobra.(*Command).execute(0x1ebeec0, {0xc0001a8130, 0x5, 0x5})
	go/1.18.1/pkg/mod/github.com/spf13/cobra@v1.4.0/command.go:856 +0x67c
github.com/spf13/cobra.(*Command).ExecuteC(0x1ebeec0)
	go/1.18.1/pkg/mod/github.com/spf13/cobra@v1.4.0/command.go:974 +0x3b4
github.com/spf13/cobra.(*Command).Execute(...)
	go/1.18.1/pkg/mod/github.com/spf13/cobra@v1.4.0/command.go:902
go.mercari.io/yo/cmd.Execute(...)
	go/1.18.1/pkg/mod/go.mercari.io/yo@v0.5.2/cmd/root.go:110
main.main()
	go/1.18.1/pkg/mod/go.mercari.io/yo@v0.5.2/main.go:30 +0x25

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions