Skip to content

Field order changed in sqlc v1.27 breaking sqlc-gen-python #3541

Open
@kevinvalk

Description

@kevinvalk

Version

1.27.0

What happened?

In Python the generated code requires to be ordered in a certain way (fields with defaults at the end). This was taken care by the following code in the sqlc-gen-python plugin

https://github.com/sqlc-dev/sqlc-gen-python/blob/3d5cd342d23ae143ed892170ffecda20ff9a1958/internal/gen.go#L1088-L1091

Between version 1.26.0 and 1.27.0, something was changed that broke that sorting. Now, fields are not ordered correctly anymore and in the case of Python, the generated files will break Python.

Metadata

Metadata

Assignees

No one assigned

    Labels

    🔧 pythonPull requests that update Python codebugSomething isn't workingregression

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions