[Q] serializing Database Null values (design question)

I have my CPP ORM pretty much working (so that I can read data from the database and serialize it with boost serialize) in generic manner. There is an issue however with 'Nulls' that possibly exist in the database. I use underneath OTL c++ db library and it has a 'null indicator' like many db libraries do. So if I see a value where null indicator is set to true, should I serialize it out and if yes -- is there something like 'NaN' for all the different value types defined? or should I skip serializing that specific field? that would I think work (unless I do not foresee something) -- in the sense that the field will not get loaded back by 'unserialize' and therefore will contain the value assigned in its constructor. just wanted to hear opinions on this. thank you -- V S P toreason@fastmail.fm -- http://www.fastmail.fm - mmm... Fastmail...

V S P wrote:
I have my CPP ORM pretty much working
(so that I can read data from the database and serialize it with boost serialize) in generic manner.
There is an issue however with 'Nulls' that possibly exist in the database.
I use underneath OTL c++ db library and it has a 'null indicator' like many db libraries do.
So if I see a value where null indicator is set to true, should I serialize it out and if yes -- is there something like 'NaN' for all the different value types defined?
What about using boost::optional to hold the value and serialize it ? IIRC serialization of empty optional should work properly. -- ___________________________________________ Joel Falcou - Assistant Professor PARALL Team - LRI - Universite Paris Sud XI Tel : (+33)1 69 15 66 35
participants (2)
-
joel
-
V S P