Skip to content

At compile-time, verify type definitions during derive for postgres #502

Open
@mehcode

Description

@mehcode
CREATE TYPE color AS ENUM ( 'red', 'green', 'blue' );
#[derive(sqlx::Type)]
#[sqlx(rename = "color", rename_all = "lowercase")]
enum Color { Red, Green, Yellow }

The above should be a compile-time error. It's currently a subtle bug as it doesn't actually error in any meaningful way apart from not being able to load or store correctly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions