You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are some problems with the Nullable implementation in ddb:
The way Variant is used, with a void* it doesn't compile. It think it's because null has its own type now. This is easily fixable, replace void* with typeof(null)
Nullable doesn't allow to store types that are already nullable. This might cause a problem for strings. Since in D there's no practical difference compared to null and an empty string. One the other hand databases usually do make a difference between the empty string and NULL. I guess it's possible to check .ptr if a string is null or not, but that will result in a different API for checking if something is null or not
It's a bit wasteful to use a pointer (8 bytes on 64bit) to indicate if a value is present or not. A Nullable!(bool) has the size of 16 while a std.typecons.Nullable!(bool) has the size 2
Thoughts, is this something with could change? We could just go with std.typecons.Nullable, the difference is that it's not possible to assign null to std.typecons.Nullable, it has a nullify method instead.
The text was updated successfully, but these errors were encountered:
There are some problems with the Nullable implementation in ddb:
Variant
is used, with avoid*
it doesn't compile. It think it's becausenull
has its own type now. This is easily fixable, replacevoid*
withtypeof(null)
Nullable
doesn't allow to store types that are already nullable. This might cause a problem for strings. Since in D there's no practical difference compared tonull
and an empty string. One the other hand databases usually do make a difference between the empty string andNULL
. I guess it's possible to check.ptr
if a string isnull
or not, but that will result in a different API for checking if something isnull
or notNullable!(bool)
has the size of 16 while astd.typecons.Nullable!(bool)
has the size 2Thoughts, is this something with could change? We could just go with
std.typecons.Nullable
, the difference is that it's not possible to assignnull
tostd.typecons.Nullable
, it has anullify
method instead.The text was updated successfully, but these errors were encountered: