vonagam

vonagam

Discussion about changing default nullability in Ash 4

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)?

Most Liked

BartOtten

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

zachdaniel

Creator of Ash

The igniter script would go through and set the value of allow_nil?: true to all attributes that don’t have the option set to false, so resources would maintain their current behavior.

Last Post!

garrison

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: false in all of my Ecto migrations so I’d probably give this a thumbs-up! :slight_smile:

Where Next?

Popular in Discussions Top

AstonJ
Are there any Elixir or Erlang libraries that help with this? I’ve been thinking how streaming services like twitch have exploded recentl...
New
ricklove
I was just introduced to Elixir and Phoenix. I was told about the 2 million websocket test that was done 2 years ago. From my research, t...
New
jesse
Hi everyone, I hesitated to post this here because I don’t want you to think I’m spamming, but I’ve been working on a Platform-as-a-Serv...
New
sergio
There’s a new TIOBE index report that came out that shows Elixir is still not in the top 50 used languages. It also goes on to call Elix...
New
PragTob
Hey everyone, this has been brewing in my head some time and it came up again while reading Adopting Elixir. GenServers, supervisors et...
New
jer
I’ve been using umbrellas for a while, and generally started off (on greenfield projects at least) by isolating subapps based on clearly ...
New
shishini
I think this twitter post and youtube video didn’t get as much attention as I hoped I am still new to Elixir, so can’t really judge ...
New

Other popular topics Top

vertexbuffer
Hello, can anybody help here..? I have a list of players and I what to delete an element, but every for loop the list is reverting to ori...
New
Darmani72
If I have a post route which an argument: post /my_post_route/:my_param1, MyController.my_post_handler How would get the post params ...
New
aadeshere1
I have a another noob question about loop. Since elixir is immutable, while loop is not directly possible. total = 10 while total != 0 ...
New
greenz1
I have a phoenix application from which a user can download multiple(5-6) files of size 1MB. I couldn’t find anything related to sending ...
New
sen
Hi All, I set a environment variables in dev.exs , like below code. when i start server, how can i set the ${enable} value? thanks. d...
New
dblack
I’ve got an issue with an app and I’ve no idea of how to troubleshoot it. I’m hoping someone here might have seen something similar. I p...
New

We're in Beta

About us Mission Statement