drift
drift copied to clipboard
Nullable Columns Without Defaults use `Value`
Nullable Columns Without Defaults
Why does this column need to be constructed with a Value e.g. create(title:Value("Pizza"))
TextColumn get title => text().nullable()();
It can be empty because a withDefault or clientDefault wasn't provided. So Value.empty() has the exact same effect as null.
Good point! Changing this would be breaking, but IMO it would make things easier if create / Companion.insert only requires a value wrapper if the column is nullable and has a default.
How queezy are you about breaking releases? Would you make one just for this?
Not just for this, but having one for all breaking enhancement could be worth it.
The reason I'm holding back on breaking releases is that with macros coming up eventually, we'll probably have some major design changes on how tables are defined - I don't want to do to two breaking releases in short succession (from experience, it takes actual years until we stop getting issues for outdated major versions).
Since this only affects the generator, I think we can introduce a builder option as an opt-in. In a future major release, we make this the default (e.g. an opt-out) or the only generation mode.