We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
query_parameter_limit
1.26.0
When using :copyfrom query with query_parameter_limit set, generated code will still try to use parameter struct:
:copyfrom
func (q *Queries) CreateAuthors(ctx context.Context, arg []CreateAuthorsParams) (int64, error) { return q.db.CopyFrom(ctx, []string{"author"}, []string{"name", "bio"}, &iteratorForCreateAuthors{rows: arg}) }
Meanwhile, if you use :one it will respect set query_parameter_limit:
:one
func (q *Queries) CreateAuthor(ctx context.Context, name string, bio pgtype.Text) (int64, error) { row := q.db.QueryRow(ctx, createAuthor, name, bio) var id int64 err := row.Scan(&id) return id, err }
No response
CREATE TABLE author ( id BIGSERIAL PRIMARY KEY, name text NOT NULL, bio text );
-- name: CreateAuthor :one INSERT INTO author (name, bio) VALUES (@name, @bio) RETURNING id; -- name: CreateAuthors :copyfrom INSERT INTO author (name, bio) VALUES (@name, @bio);
{ "version": "2", "sql": [{ "schema": "schema.sql", "queries": "query.sql", "engine": "postgresql", "gen": { "go": { "out": "db", "query_parameter_limit": 100, "sql_package": "pgx/v5" } } }] }
https://play.sqlc.dev/p/849ecfee7a92c0862b4e877189cb3ddd33c2b181ae1266ada98e8f25f635004f
Linux
PostgreSQL
Go
The text was updated successfully, but these errors were encountered:
I am having the same issue
Sorry, something went wrong.
No branches or pull requests
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
The text was updated successfully, but these errors were encountered: