Skip to content

sqlc generates invalid code for inserts returning * when query_parameter_limit > 2 #2678

Closed
@andrewmbenton

Description

@andrewmbenton

Version

1.20.0

What happened?

The insert query function is missing a variable to scan into when query_parameter_limit > 2. It appears that the number of query parameters must also be > 2 but <= query_parameter_limit to trigger the invalid codegen.

See the playground link for an example.

Relevant log output

No response

Database schema

No response

SQL queries

No response

Configuration

No response

Playground URL

https://play.sqlc.dev/p/e986c5254a2e3c9d6c62daa78950d545417c92622f97b7d0ee59433baa727cd5

What operating system are you using?

No response

What database engines are you using?

PostgreSQL

What type of code are you generating?

Go

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtriageNew issues that hasn't been reviewed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions