Skip to content

Parameters instead of structs #2098

Closed
Closed
@polderudo

Description

@polderudo

What do you want to change?

Right now, when we do an insert/update/select sqlc generates a struct for the needed sql-parameters most time.
If one changes a parsed query (e.g. add a new param), the generated struct also changes. Now we have to check every single location, where the struct is used, in order to be sure, that we populate the struct with all new values, else the go default values will be used for that fields.

It would be a very helpfull feature, if we could have the values just as regular params on the query function. The compiler would warn if we miss a value. Maybe create the struct inline and use it only inside the functions, so we don't have to change the other functionality?

What database engines need to be changed?

No response

What programming language backends need to be changed?

Go

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions