question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Is there support for columns that take enums as type (like postgres has!)

See original GitHub issue

Is there a support for enum types in piccolo? or an approach to achieve it like DjangoMixin. This just an enquiry didn’t have a forum to ask for help hence posting it here.

Thanks! Awesome work btw.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
sinisaoscommented, Dec 15, 2020

@dashsatish I don’t think that for now Piccolo have that feature but probably Daniel know better. Maybe is easiest workaround is to use reference table and pass FK to table you need. Piccolo has nice Readable feature to present nice dropdown in Piccolo admin. Sorry if I miss your point.

1reaction
dashsatishcommented, Dec 15, 2020

@satishdash Thanks for your interest in the project. As @sinisaos says, Piccolo doesn’t currently support enums unfortunately. The best way to handle it for now is a foreign key to a separate table, or to handle the validation in your app somehow.

I don’t think it would be too hard to add for Postgres, so I’ll put it on the roadmap.

Exactly! just wanting to know your thoughts on this on how to handle it. And yes since postgres is the most used RDMS DB store, it’d be a good add. But thanks for the suggestions anyways.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Documentation: 15: 8.7. Enumerated Types - PostgreSQL
Enumerated (enum) types are data types that comprise a static, ordered set of values. They are equivalent to the enum types supported in...
Read more >
Postgres ENUM data type or CHECK CONSTRAINT?
Based on the comments and answers here, and some rudimentary research, I have the following summary to offer for comments from the Postgres-erati....
Read more >
Rails 7 adds better support for custom enum types in ...
PostgreSQL provides in-built support for enumerated types that Rails can then take advantage of. However, it is often a pain to make use...
Read more >
Dealing with Enum Type in PostgreSQL - DEV Community ‍ ‍
This is a brief guide for effectively understanding and working with enum type in Postgres: Why does it exist? What does it do?...
Read more >
How enum works in PostgreSQL? (Examples) - eduCBA
PostgreSQL enum is the data type that was used in PostgreSQL to stored same type of values in column field, we can store...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found