delaneyj / toolbelt

A set of utilities used in every go project
MIT License
12 stars 3 forks source link

blob type not supported #5

Closed SirMetathyst closed 1 month ago

SirMetathyst commented 1 month ago

Hello, I wanted to store some binary data in sqlite but sqlc-gen-zombiezen does not support blob data type:

schema input

CREATE TABLE authors (
  id   INTEGER PRIMARY KEY,
  name text    NOT NULL,
  bio  text,
  data BLOB
);

output error:

# package zz
error generating code: process: error running command panic: toGoType unhandled type BLOB for column data

goroutine 1 [running]:
github.com/delaneyj/toolbelt/sqlc-gen-zombiezen/zombiezen.toGoType(0xc000254370)
        /home/sirmetathyst/go/pkg/mod/github.com/delaneyj/toolbelt@v0.2.13/sqlc-gen-zombiezen/zombiezen/queries.go:125 +0x228
github.com/delaneyj/toolbelt/sqlc-gen-zombiezen/zombiezen.generateCRUD(0xc0000f0b40)
        /home/sirmetathyst/go/pkg/mod/github.com/delaneyj/toolbelt@v0.2.13/sqlc-gen-zombiezen/zombiezen/crud.go:37 +0x665
github.com/delaneyj/toolbelt/sqlc-gen-zombiezen/zombiezen.Generate({0xc0000c8400?, 0x14c?}, 0xc0000f0b40)
        /home/sirmetathyst/go/pkg/mod/github.com/delaneyj/toolbelt@v0.2.13/sqlc-gen-zombiezen/zombiezen/gen.go:31 +0x325
main.run()
        /home/sirmetathyst/go/pkg/mod/github.com/delaneyj/toolbelt@v0.2.13/sqlc-gen-zombiezen/main.go:33 +0x11f
main.main()
        /home/sirmetathyst/go/pkg/mod/github.com/delaneyj/toolbelt@v0.2.13/sqlc-gen-zombiezen/main.go:17 +0x13

pkg/sqlite/package.go:1: running "sqlc": exit status 1
delaneyj commented 1 month ago

Fixed in v0.2.15