Skip to content

PG enum values ordering not stable #429

Description

@itizir

Hello!

So one thing we noticed is that the generated code for enum does not seem to guarantee a stable ordering of values, at least for Postgres. The order is consistent most of the time, but not all the time.

It seems to be because the query done in models/enumvalue.dbtpl.go does not include ordering, thus may not necessarily return the rows in the same order each time, and client-side there is no sorting done either.

Fix should be easy (either add an ORDER BY clause, or sort client-side), but it's probably for you to decide where and how you would want to do that :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions