Skip to content

Check constraints to generate specific types #152

@cssinate

Description

@cssinate

Imagine I have a table members with a column role. I add the following constraint:

ALTER TABLE members ADD CONSTRAINT members_role_name CHECK (((role)::text = ANY ((ARRAY['participant'::character varying, 'invitee'::character varying, 'applicant'::character varying])::text[])));

It would be really nice if the type for role was not just string but 'participant' | 'invitee' | 'applicant'

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