Closed abijr closed 3 years ago
Thanks for the detailed bug report. I've verified that it's definitely broken with:
pggen gen go --query-glob 'one.sql' --query-glob 'two.sql'
I have a few ideas for fixes. I'll likely need some sort of package
struct.
You should be good to go with e7b20e4. The new release at https://github.com/jschaf/pggen/releases/tag/2021-03-25 has the fix.
@jschaf This issue seems still happen.
oops, just ignore that comment. It works, go get -u
can not upgrade the binary. Could u pls add a tag or version to command line outputs?
Yea, I'm not sure how to give install instructions via go get
. Last time I checked, the Go authors don't seem particularly eager to become a binary distribution mechanism.
Querier interface only has the methods generated from the Leader file.
Example: https://gist.github.com/abijr/ea58ff718b99a830c79772c803b86743
You can see that only the QueryOne methods are added to the Querier interface, QueryTwo is ignored: https://gist.github.com/abijr/ea58ff718b99a830c79772c803b86743#file-one-sql-go-L17-L24
I expected it to include all the queries from all the generated files.
I think that the problem is that only the queries that correspond to a single file are stored the TemplatedFile struct. Not sure how you would like to approach the fix.