Skip to content

Feature request: rename_all container attribute #934

Closed
@allan2

Description

@allan2

A Postgres type like so

CREATE TYPE mood AS ENUM ('sad', 'happy');

can be represented like this

#[derive(ToSql, Debug)]
#[postgres(name = "mood")]
enum Mood {
    #[postgres(name = "sad")]
    Sad,
    #[postgres(name = "happy")]
    Happy
}

This is a request for a container attribute like Serde's rename_all [1]

#[derive(ToSql, Debug)]
#[postgres(rename_all = "lowercase")]
enum Mood {
    Sad,
    Happy
}

What do you think?

--
#894 related

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions