gjaldon
As the title states, EctoEnum has just been updated after some time of hardly any activity in the repo. Here’s the latest release: Release 0.3.2 · gjaldon/ecto_enum · GitHub
The latest release still isn’t compatible with Ecto 1.1 to 2.0. I’ll be working on that in the upcoming days. There’s been significant change in how custom Ecto types work in 1.1 so it will take a bit more work. ![]()
Would appreciate any feedback! Enjoy!
Trending in Announcing
Flop is an Elixir library that applies filtering, ordering and pagination parameters to your Ecto queries.
offset-based pagination with...
New
I needed to reuse React components from my Chrome extension in my Phoenix/LiveView backend. I noticed that for Svelte/Vue, there are live...
New
I released Doggo, a collection of unstyled Phoenix components.
https://github.com/woylie/doggo
Features
Unstyled Phoenix components....
New
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
Hi there! We created Gust: A task orchestrator inspired by Airflow.
For those who have never heard about Aiflow, it’s a Python-based wor...
New
Hello
Published a new library - ProcessHub!
ProcessHub is a library designed to manage process distribution within the Elixir cluster. ...
New
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Other Trending Topics
I am happy to introduce the very α version of the new programming language compiled to BEAM.
Welcome Cure.
It has literally three kille...
New
Hi everyone!
The first release candidate for the Expert language server project is now available!
We’ve published a press release detai...
New
With AI doing more of the implementation work, I’ve been wondering how much coding I should deliberately keep doing myself.
My main conc...
New
It’s not that it’s vocabulary is too advanced. It’s something worse.
I get lost trying to follow even a paragraph written by Claude. It’...
New
This showed up on my feed.. anyone heard of it? Just hype?
Ox Alpha is a reasoning model designed for coding, sustained ag...
New
Hey folks,
I just published a post about Hologram’s funding and where the project goes next - the short version:
Curiosum as Main Spons...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixirconf-us
- #ai
- #blog-post
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #metaprogramming
- #hex
- #security










Showing Posts 1 to 10- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
OvermindDL1
I’m looking forward. I skipped by EctoEnum because of lack of Ecto2 support so I will look at it again here soon.
It would be nice if it had a mode where it could work with native PostgreSQL Enum types as I am already using those in my app and it would be nice to have better checks for it.
mgwidmann
I feel like this example:
Should include the enum type in the error message. Something like:
:none is not a valid enum value for StatusEnumBut good work! Would like to see this working for Ecto 2.0 as well!
gjaldon
Thanks for the suggestion! I’ll look into that some more once I work on Ecto2 support. I’ll keep you posted once Ecto 2 support is in.
gjaldon
That definitely makes the error message clearer! Added an issue for it at Clearer error message for invalid enum value · Issue #13 · gjaldon/ecto_enum · GitHub
gjaldon
EctoEnum now supports Postgres’ Enumerated Type
Thanks for the suggestion @OvermindDL1!
Ecto 2.0 should be out this week too
OvermindDL1
Whoo!
Very Whoo!
idi527
Just in case anyone is looking for a way to use postgres enum types with ecto, here’s how (without any additional dependencies).
gjaldon
No doubt you could write your own code to create a custom Ecto type. The point of this small and focused library is to do the metaprogramming for you so don’t need to write that code every time you need to create an Enum in Ecto. With EctoEnum, you just need to write a few lines of code to have a
StatusEnum,DayOfWeekEnum, etc… Also, this library actually has tests and is used by many other devs. That’s the point of having libraries and sharing packages, so we can focus on other work.gjaldon
Oh and EctoEnum works with Postgres’s Enum type or a plain ol’ integer. It will have support for MySQL’s Enum type in the future too.
boddhisattva
@gjaldon Thanks for your package. I’ve tried this recently and it works well. If there’s one feedback that I can give it would have to do with the ordering of the sections in the README, it has a Usage, a Reflection and then a Using Postgres’s Enum type. For the first 1 hour or so, I couldn’t get this working for me as I didn’t bother reading through the whole README, especially after seeing the Reflection part. After reading a little further I realized this is actually a
reflection functionand not areflection as in conclusionthing.Only after digging further, I found the relevant info wrt postgres and it works well
Thank you for your work on this.
May I ask you, how can I use this package to add more types to an existing enum in my app given that we’ve already built the initial enum using the ecto enum package. I don’t see any documentation on this and would be great to have some documentation around this as there is a possibility that we may add more types to an existing Enum in our project. I’ve created a relevant issue on github around this with some more info
Thank you.