Closed flash-gordon closed 6 years ago
To be honest, this should be adapter-specific. ie if a database supports default values, then it should be used. Using default values in structs that rom loads is a code smell for me.
@solnic it's more about input schemas that inject a default value on nil
. I would argue they should do it on missing key instead.
@flash-gordon ah right, well, would be good to maintain treating nil
as a trigger for default value. Otherwise we'd have to rewrite input hashes every time a command is applied, which may have negative performance impact.
@solnic hm, actually, I can't see what's the difference between these approaches, even nil
s have to be overridden with default values, hashes will be rewritten in both cases
@solnic I wonder what's our plan for default types. It's easy to make them work as before (i.e.
nil
triggers a default value) but I think we should change this behavior in the next version. FYI SQL's defaults work in the same way, if you insertNULL
it doesn't use the default value.