Open KlemenPl opened 4 months ago
I am having the same issue
As copyfrom
is a function to import multiple rows at once it makes sense that it always takes an slice as input. What would the interface be otherwise?
func (q *Queries) CreateAuthors(ctx context.Context, author1, bio1, author2, bio2)
is far from ergonomic to use.
As
copyfrom
is a function to import multiple rows at once it makes sense that it always takes an slice as input. What would the interface be otherwise?
func (q *Queries) CreateAuthors(ctx context.Context, author1, bio1, author2, bio2)
is far from ergonomic to use.
I agree, it should take slice as an input. My problem is that CreateAuthorParams
is not generated, if you use query_parameter_limit
and therefore the code does not compile (please see playground example).
I've run into that as well. It is a known issue (#3197) and already fixed in the main branch (#3446). The problem being that it is not yet released.
You could go install
the latest commit and execute the binary from the go/bin
folder.
Version
1.26.0
What happened?
When using
:copyfrom
query withquery_parameter_limit
set, generated code will still try to use parameter struct:Meanwhile, if you use
:one
it will respect setquery_parameter_limit
:Relevant log output
No response
Database schema
SQL queries
Configuration
Playground URL
https://play.sqlc.dev/p/849ecfee7a92c0862b4e877189cb3ddd33c2b181ae1266ada98e8f25f635004f
What operating system are you using?
Linux
What database engines are you using?
PostgreSQL
What type of code are you generating?
Go