adamdruppe / arsd

This is a collection of modules that I've released over the years. Most of them stand alone, or have just one or two dependencies in here, so you don't have to download this whole repo.
http://arsd-official.dpldocs.info/arsd.html
530 stars 125 forks source link

database.d: Change suggestion: Change Row.rows from string[] to Variant[] #340

Closed vabenil closed 1 year ago

vabenil commented 1 year ago

Currently after a query is done the values of the fields of each row are converted to string. This however doesn't take into consideration the null type. in D null == "" returns true, so if you have a string field it's impossible to differentiate if said field is null or just empty in the database. Which is an important differentiation to make.

adamdruppe commented 1 year ago

in D null == "" returns true,

But str is null and str == "" are two different things.

Though yes, I want to change this anyway - i want to get away from Variant and string - but you should be able to detect it with the is null test.

vabenil commented 1 year ago

Oh, I didn't know about str is null I only tried "str == null". It should be okay then. I will close this then.