bencoppock
Elixir Blog Post: Avoiding Atomic Angst in Elixir
I write about the frustration that can occur when dealing with string and atom-based keys in maps and how to (safely) translate string-based map keys to atoms:
First Post!
Most Liked
gregvaughn
I would be looking at Ecto.Changeset.apply_action/2 to return either {:ok, struct} or {:error, changeset} which contains errors in the 2nd case. But it certainly depends on ecto (though not ecto_sql).
1
Last Post!
bencoppock
I wasn’t writing this with Ecto in mind, but I usually do have Ecto in the mix, so I like that.
It also feels cleaner to use the return of the apply_action function (which can include validation errors) as opposed to directly relying on the changes field in the Changeset struct (even though I think the field is more or less considered “public”).
0
Popular in Blog Posts
An infographic that compares Erlang, Elixir, and Go’s strengths in the respect to the programming languages’ concurrency, reliability, sc...
New
In this series, we take a look at the different ways to organize, structure and execute a good “flow” in our Elixir programs.
The latest...
New
Update:
How to use the blogs section
You can post in one of the Official Blog Posts threads (like this one), or, via Devtalk and a new t...
New
Introduction and first content post in my new series about running Elixir Phoenix apps on Kubernetes are live! I’m describing an opiniona...
New
Here’s the story how one of the world’s first production deployments of LiveView came to be - and how trying to improve it almost caused ...
New
Add drag-and-drop functionality to your Phoenix LiveView app with SortableJS and LiveView Hooks! This posts shows you how to create an in...
New
TL;DR:
Good: AI is great at Elixir. It gets better as your codebase grows.
Bad: It defaults to defensive, imperative code. You need...
New
Other popular topics
TL;DR: I’ve just released an implementation of Microsoft’s IDE-independent Language Server Protocol for Elixir. It adds language support ...
New
I wrote this comment on r/haskell, and it’s not popular there. :wink: But I think I’m on to something…
Haskell reminds me of Java, and e...
New
Hey,
Just curious what are the main benefits of Elixir compared to Clojure?
When is Elixir more useful than Clojure and vice versa?
Th...
New
This post is an instruction guide to help you setup your Neovim for Elixir development from scratch. It includes general information on h...
New
I have a server on AWS, and was running a load test using artillery. When looking at the Phoenix dashboard I see the Ports going to 100% ...
New
In the code below, if the create action is not set to accept “extra_key” as an input, it errors out with a message shown above. Is there ...
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
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #elixirconf-us
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #metaprogramming
- #security
- #hex









