Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support sqlite aggregate functions in sqlc-gen-zombiezen #19

Open
bannatech opened this issue Oct 25, 2024 · 0 comments
Open

Support sqlite aggregate functions in sqlc-gen-zombiezen #19

bannatech opened this issue Oct 25, 2024 · 0 comments

Comments

@bannatech
Copy link

When generating code, sql statements containing aggregate functions fail:

# package zz
error generating code: process: error running command panic: toGoType unhandled type 'any' for column 'max'

goroutine 1 [running]:
github.com/delaneyj/toolbelt/sqlc-gen-zombiezen/zombiezen.toGoType(0xc00025e420)
        third_party/go/sqlc_gen_zombiezen/_sqlc_gen_zombiezen_src/sqlc-gen-zombiezen/zombiezen/queries.go:134 +0x28e
github.com/delaneyj/toolbelt/sqlc-gen-zombiezen/zombiezen.generateQueries.func2(_, _)
        third_party/go/sqlc_gen_zombiezen/_sqlc_gen_zombiezen_src/sqlc-gen-zombiezen/zombiezen/queries.go:49 +0x78
github.com/samber/lo.Map[...]({0xc000078668?, 0x1, 0x7}, 0xc0001a7c98?)
        pkg/linux_amd64/github.com/samber/lo/slice.go:30 +0xe2
github.com/delaneyj/toolbelt/sqlc-gen-zombiezen/zombiezen.generateQueries(0xc0000e07e0)
        third_party/go/sqlc_gen_zombiezen/_sqlc_gen_zombiezen_src/sqlc-gen-zombiezen/zombiezen/queries.go:48 +0x345
github.com/delaneyj/toolbelt/sqlc-gen-zombiezen/zombiezen.Generate({0xc00022c000?, 0x32d4?}, 0xc0000e07e0)
        third_party/go/sqlc_gen_zombiezen/_sqlc_gen_zombiezen_src/sqlc-gen-zombiezen/zombiezen/gen.go:25 +0x1a5
main.run()
        third_party/go/sqlc_gen_zombiezen/_sqlc_gen_zombiezen_src/sqlc-gen-zombiezen/main.go:33 +0x11f
main.main()
        third_party/go/sqlc_gen_zombiezen/_sqlc_gen_zombiezen_src/sqlc-gen-zombiezen/main.go:17 +0x13

Schema:

CREATE TABLE IF NOT EXISTS test (
    id INTEGER PRIMARY KEY,
    data INTEGER NOT NULL
);

Query:

-- name: GetTest :one
SELECT
    max(data)
FROM
    test;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant