Skip to content
This repository was archived by the owner on Jan 2, 2026. It is now read-only.

Enum en-/decodings for sqlx should be re-done #566

@bitfl0wer

Description

@bitfl0wer

In #565, I discovered that my theoretically correct fix for en-/decoding enums for sqlx didn't work as intended. The fix simply added #[repr(i16)] to u8-repr'd enums when the sqlx feature was enabled. However, we store unsigned integers using the PgSQL NUMERIC type, which Pg (or sqlx) will not auto-convert from or to.

The improved fix is to provide a custom implementation of Type, Encode and Decode for the enums which are to be represented as unsigned integers. Perhaps this could be done via a macro derive.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions