d2sqlite3 icon indicating copy to clipboard operation
d2sqlite3 copied to clipboard

Remove dependency on Variant

Open schveiguy opened this issue 1 year ago • 2 comments

The 5 types included in ColumnData are long, double, string, immutable(ubyte)[] and typeof(null).

There is no need to involve std.Variant for this. There's even a tag in the ColumnData type already!

Just a simple tagged union should suffice, there are no lifetime issues to deal with, all these are POD.

schveiguy avatar Dec 29 '23 00:12 schveiguy

So switch to sumtype ? :)

Geod24 avatar Dec 29 '23 00:12 Geod24

Even sumtype is overkill IMO.

But the main reason I would want to switch is, std.variant is unsafe. It's why I switched away from it in mysql-native.

schveiguy avatar Dec 29 '23 00:12 schveiguy