vonagam
Hi, I’ve opened a discussion on Github whenever it makes sense to change the default for nullability in Ash 4.
Right now allow_nil? option for all fields has true as a default. And to me, based on what I’ve seen in codebases, it feels like a wrong one - it’s just a less strict option that needs opt-out more often than not and because of that introduces noise to code and decreases its readability. Also it is unintuitive (so often needs to be explained to first-time users) because it does not match Elixir or even Ash conventions.
Interested in your opinions:
a) Do you find nullability by default annoying or logical and convenient?
b) If you do prefer things to be other way around and it was up to you whenever such a breaking change is introduced in Ash 4 - would you still be in favor of making the change or choose to keep things as is (because, let’s say, it is not that important and to minimize changes)?
Trending in Discussions
Other Trending Topics
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
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #blog-post
- #elixirconf-us
- #elixir-ls
- #ai
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #hex
- #security
- #metaprogramming










Showing Posts 1 to 3- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
BartOtten
a.) rather not have nullability by default
b.) option flag in 3 defaulting to nillability, switching the default value in 4.
Igniter is probably not an option as we don’t know what user code relies on the current behaviour. (?)
zachdaniel
The igniter script would go through and set the value of
allow_nil?: trueto all attributes that don’t have the option set tofalse, so resources would maintain their current behavior.garrison
But it does match standard RDBMS/SQL conventions (
NOT NULL) which many may be familiar with.For the record I am not an Ash user but I do get annoyed typing
null: falsein all of my Ecto migrations so I’d probably give this a thumbs-up!