-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
cannot unmarshal number into Go value of type map[string]interface {} #54
Comments
I just verified that installing via go install and running the author example works on main:
Does running the example from the repo work? My guess is that either schema file or query file has changed. The author example doesn't use json so that's odd. Can you verify the content hasn't changed? |
I’d suspect the database setup before blaming Windows. Pggen mostly just connects to Postgres You’ll need Docker to run pggen without a Postgres connection. If the Docker approach works it’s probably the DB setup. |
Just wanted to report back that using the docker image for postgres seemed to do the trick. Any guesses on what could be causing an issue with our existing database server? |
What's the output if you run the pggen queries manually, replacing the |
Going to close as issue was resolved. |
I am just trying to get through a basic tutorial. I installed through go install:
go install github.com/jschaf/pggen/cmd/pggen@latest
Then tried to run the following command against my postgres database:
pggen gen go \ --schema-glob author/schema.sql \ --query-glob author/query.sql
it creates the author schema in the database correctly, but I get the following error while trying to generate code for query.sql:
ERROR: parse template query file "C:\\code\\api-brand-allocation\\author\\query.sql": infer typed named query FindAuthorByID: infer output types for query: infer output type nullability: explain prepared query: can't scan into dest[0]: json: cannot unmarshal number into Go value of type map[string]interface {}
I pulled my query.sql and schema.sql from the following location:
https://github.com/jschaf/pggen/tree/main/example/author
Can't figure out what I missed, hopefully something simple. Thanks!
The text was updated successfully, but these errors were encountered: