AstonJ
Trending in News & Updates
I’m a bit excited to announce that Localize and friends are now at release 1.0. Even though it’s a 1.0 release, it stands on 8 years of w...
New
Hologram v0.11 is out! Two headline features this release. First, Elixir regexes now run in the browser. They were server-only until now,...
New
Just published search_ash 0.5.0 (with search_core 0.4.0) on Hex.
What’s new: synonyms
You can now declare a synonym dictionary per lang...
New
After years of struggling I made StreamData dependency optional.
Finitomata.ExUnit got testing primitives for Persistence.
Full back co...
New
MdexMultilineCells is an MDEx plugin enabling multi-line cells in Markdown tables with full
inline/block Markdown rendering and automati...
New
ActiveMemory 0.8.0 — in-memory tables that speak Ecto
ActiveMemory 0.8.0 is now on Hex.
ActiveMemory is an in-memory store built on ETS ...
New
Other Trending Topics
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
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
ExRatatui lets you cook up rich terminal UIs in Elixir, powered by Rust’s ratatui via Rustler NIFs. Build interactive terminal applicatio...
New
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve.
They are GUI (Emerge) and State management (S...
New
Emily is an Elixir library that runs Nx computations on Apple’s MLX. Install it as the default Nx backend and Nx, defn, Axon, Nx.Serving,...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #blog-post
- #phoenix_html
- #ai
- #iex
- #graphql
- #elixirconf-us
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #hex
- #security
- #metaprogramming










Showing Posts 1 to 9- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
Eiji
Ok, so few years have passed. Why it took so long? It simply didn’t took any time. I’ve got just a single question if this library is maintained. I said yes, but so far no issue, pull request or even a question was created.
Therefore I was just using this project for my personal purposes and slowly refactoring it when needed. I think the completely new code is much better now. The documentation should also be much cleaner. This is a first release on
hexsimply because I’m not pushing initial library code or first release candidates.enumexhave a new DSL. From now on you start with as simple code as possible and extend it by adding components. Therefore there is no convention forced to your enum module. You can use a component to integrateectoor write your own easily.All compile-time state is written into
etsstorage which means there are no module attributes that you have to be aware of. That’s said some modules may use module attributes to integrate with other library. The simplest example here isEcto.Schemaintegration (@primary_keyand@schema_prefix).What I like the most is a simple component system.
You can start with a simple
:stringmigration and end up with aPostgreSQLenumerated type or even work on runtime-determined values.Now working with enums in
Elixir,PostgreSQLor evenSQLiteis as simple as adding a component.Anyone who depends on enumerated types can use
Postgresadapter directly orMigrationwrapper. With such features migrations are very easy to setup without a need to learn how to executecreate type …sql. What’s best all migrations can be used safely on untrusted values. In my case I have used atestname as enum name. The adapter handles even the most weird cases.cmo
You might want to show how it is used, not just how enums are defined.
Eiji
Isn’t component documentation enough? Which one needs more examples? For sure the enum module itself only manages the state from
DSL(ids, indexes, value structs), so you cannot “use” it standalone. What you have to do is to add one or more components and use them as documented. Maybe this part was not documented well …dimitarvp
It’s a good practice to just copy-paste some of the onboarding docs in the forum announcement. No need to give the forum readers homework – “go read the docs” – when you can make it easier for us to decide if we’re interested in using your thing.
dbaer
I am also curious, why would I use this over Ecto.Enum?
cmo
So once you’ve defined the
:http_status_codesenum, you never reference it or use it in your code? Because that is the entirety of the guide.Eiji
@dimitarvp Oh, that’s not intended. I have focused on copy-pasting examples of definitions and other features like migration (see first post). Components are a tiny things and everyone is different, so I just don’t wanted to copy-paste all documentation.
Generally the library covers many use cases for enum, so the best examples for you depend on what’s your needs.
Ecto.Enumis a simple module that implementsEcto.ParameterizedTypebehaviour. That’s what one of my components do. My version is more complex and generates acasestatement at compile-time, so it should be much more faster.For example if you pass
ecto_type: :idorecto_type: :integeroption then instead of enum id (like:first) it would save the enum index (like1) into the database. That’s said you don’t have to useectoat all if you want justElixir-side features or write a component to integrate enum with other library.What I wrote before is just direct comparison to
Ecto.Enummodule. The library offers much more features and covers many other cases (database validations using enumerated type for static values or relation for dynamic values). The main documentation page mentions all use cases and provides a mermaid graph for comparison of features.What you may find interesting is also a fact that all
DSLmacros usesEnumex.macro_input(type)type which means that you can pass anyElixirexpression including module attributes, variables or function calls. The code works in the module compilation-time and not specificDSLcompilation time.Yes, as mentioned in this reply I split the documentation on the enum module definitions and components. I could copy-paste example of one component, but you may be interested in using another one, but let’s try …
I decided to share this example as I did not saw anyone working on similar components/features before for enums.
The components give you freedom. You can work on list of ids and fetch index when needed, same for index and same goes for opposite case. You can also simply work on a list of values, but I imagine that in some sensitive cases it’s better to work on as small amount of data as possible (without using maps or structs).
I’m really thankful for those questions. As you see this library is something more than complex version of
Ecto.Enumand I need a bit more precise use cases to provide examples you need. Do you need to import absinthe enum definitions or maybe something else? Let me know!I highly recommend to read the documentation starting from introduction, then how to define enum (or simple see examples in the guides instead) and then focus on the component you are interested in. Each one gives you completely different features that you may use alone or together. It’s up to you what features would have your enum module.
Advanced features for databases like migration and adapter could be read later if you find this library helpful for your use case or if you need to work with
PostgreSQLenumerated type instead of plain values or when you would like to query index for specific enum id using a custom database function.sleipnir
First-Class gRPC Streams in Elixir: A new composable API
For a long time, the Elixir community has lacked a truly idiomatic way to handle gRPC streaming. While unary RPCs have always been well-supported in the elixir-grpc library, stream handling felt incomplete — too low-level and too imperative for a language that thrives on functional and reactive principles.
This gap was finally addressed in issue #270, which led to a major improvement: first-class support for gRPC streams using a functional and declarative API that fits seamlessly into the Elixir ecosystem.
It’s worth highlighting the irony: while Elixir is inherently concurrent and reactive — thanks to the BEAM and its actor-based model — its gRPC streaming capabilities lagged behind those found in other ecosystems.
Languages like Java (via Project Reactor or RxJava), Kotlin (with coroutines and Flows), and JavaScript (using RxJS or async iterators) have long embraced reactive paradigms for working with gRPC streams. These models allowed developers to work with streams as composable, functional data flows.
Until recently, Elixir developers lacked similar expressive power. The new API introduced in version
0.10.0finally brings that same level of expressiveness and control to the Elixir world — and in a way that feels natural, pure, and declarative.A Functional API for Streaming
The new streaming API is designed around stream composition and functional data flows, relying on
GRPC.Streamto model and process streaming inputs and outputs. This new abstraction enables a developer experience that feels intuitive, powerful, and aligned with some Elixir’s design principles.Here’s an example of the new API in action:
As seen in the example above, composing different stages in the streaming pipeline is straightforward. Each step in the transformation can be expressed clearly, making the overall flow easier to follow and reason about.
To support this, the
GRPC.Streammodule offers a set of functions designed to operate directly on the stream, such asmap,filter,flat_map,partition,reduce,uniqand so on. These utilities provide the flexibility needed to build expressive and efficient streaming logic while maintaining clarity and composability throughout the pipeline.Conclusion
The introduction of a first-class streaming API represents a meaningful step forward for the Elixir gRPC ecosystem. It provides a more consistent and idiomatic way to implement streaming services using well-established functional constructs.
This new approach makes it easier to model real-time interactions, handle bi-directional communication, and process data streams using composable and readable code.
Further details and examples can be found in the official elixir-grpc repository and hex.
restlessronin
I have released v0.9.17 to hex with support for the Conversations endpoint
Shoutout to @eddy147 for filing the issue.