Skip to content

May I kindly ask you to support View? #95

@dulao5

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/[email protected]/internal/loader.go:179 +0x212
go.mercari.io/yo/internal.(*TypeLoader).LoadTable(0xc0001c1890, 0x1ecc660)
	go/1.18.1/pkg/mod/go.mercari.io/[email protected]/internal/loader.go:133 +0x1a5
go.mercari.io/yo/internal.(*TypeLoader).LoadSchema(0x0?, 0xc00034b220?)
	go/1.18.1/pkg/mod/go.mercari.io/[email protected]/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/[email protected]/cmd/root.go:83 +0x21f
github.com/spf13/cobra.(*Command).execute(0x1ebeec0, {0xc0001a8130, 0x5, 0x5})
	go/1.18.1/pkg/mod/github.com/spf13/[email protected]/command.go:856 +0x67c
github.com/spf13/cobra.(*Command).ExecuteC(0x1ebeec0)
	go/1.18.1/pkg/mod/github.com/spf13/[email protected]/command.go:974 +0x3b4
github.com/spf13/cobra.(*Command).Execute(...)
	go/1.18.1/pkg/mod/github.com/spf13/[email protected]/command.go:902
go.mercari.io/yo/cmd.Execute(...)
	go/1.18.1/pkg/mod/go.mercari.io/[email protected]/cmd/root.go:110
main.main()
	go/1.18.1/pkg/mod/go.mercari.io/[email protected]/main.go:30 +0x25

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