Skip to content

Fetching all enum values from the database #947

Answered by s0kil
s0kil asked this question in Q&A
Discussion options

You must be logged in to vote

I have a ENUM defined as:

CREATE TYPE brokerage_subscription_type AS ENUM ('basic_subscription', 'bronze_subscription', 'silver_subscription', 'gold_subscription');

To get a list of all the ENUM values:

subscriptionTypes :: [BrokerageSubscriptionType] <- sqlQueryScalar "SELECT enum_range(NULL::brokerage_subscription_type)" ()

Replies: 1 comment 1 reply

Comment options

s0kil
Jun 30, 2021
Collaborator Author

You must be logged in to vote
1 reply
@mpscholten
Comment options

Answer selected by s0kil
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants