Skip to content

Fetch an enum stored by its raw value by specifying the case #15

@ABridoux

Description

@ABridoux

It is possible currently to fetch on an attribute with is destined to be converted an an enum value:

Animal.request().all().where(\.type == AnimalType.duck.rawValue)

It would be nice to be able to remove the boilerplate.

Animal.request().all().where(\.type == .duck)

To do so, maybe the Predicate struct should hold another generic DatabaseModel type since the mapping from a raw value to a enum is known in the model.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions