cube2222 / octosql

OctoSQL is a query tool that allows you to join, analyse and transform data from multiple databases and file formats using SQL.
Mozilla Public License 2.0
4.74k stars 201 forks source link

`octosql 'SHOW TABLES'` panics #296

Closed alecthomas closed 1 year ago

alecthomas commented 1 year ago
🐚 ~/Projects/hermit-packages $ octosql 'show tables'
panic: interface conversion: *sqlparser.Show is not sqlparser.SelectStatement: missing method iInsertRows

goroutine 1 [running]:
github.com/cube2222/octosql/cmd.glob..func4(0x10195d9c0, {0x1400007e0e0, 0x1, 0x1?})
    /home/runner/work/octosql/octosql/cmd/root.go:232 +0xebc
github.com/spf13/cobra.(*Command).execute(0x10195d9c0, {0x140001ae010, 0x1, 0x1})
    /home/runner/go/pkg/mod/github.com/spf13/cobra@v1.4.0/command.go:856 +0x4c4
github.com/spf13/cobra.(*Command).ExecuteC(0x10195d9c0)
    /home/runner/go/pkg/mod/github.com/spf13/cobra@v1.4.0/command.go:974 +0x354
github.com/spf13/cobra.(*Command).Execute(...)
    /home/runner/go/pkg/mod/github.com/spf13/cobra@v1.4.0/command.go:902
github.com/spf13/cobra.(*Command).ExecuteContext(...)
    /home/runner/go/pkg/mod/github.com/spf13/cobra@v1.4.0/command.go:895
github.com/cube2222/octosql/cmd.Execute({0x10135d148?, 0x1400028edc0?})
    /home/runner/work/octosql/octosql/cmd/root.go:466 +0x64
main.main()
    /home/runner/work/octosql/octosql/main.go:24 +0xec
cube2222 commented 1 year ago

@alecthomas The error message could probably be better, but SHOW TABLES is intentionally not implemented.

alecthomas commented 1 year ago

Yep, I figured.

cube2222 commented 1 year ago

Fixed in https://github.com/cube2222/octosql/commit/1acc4eb58add5a082acda1640b098ea9c68e7354