[odb-users] Variant type mapping?

Alexander A. Prokhorov prokher at gmail.com
Sat Apr 7 11:48:36 EDT 2012


Dear colleagues,

I was thinking about using ODB in my project, I've tried several trivial 
cases and it showed itself well. Then I've faced tricky case. I need to 
store Variant type (QVariant or boost::variant, whatever) in DB. Do you 
have any recommendations how to perform this? I understand that I can 
create table "Variants" with columns "id", "type_id", 
"type_specific_id", where "type_specific_id" points to the record in the 
table implicitly pointed by "type_id". I feel this approach 'smells' a 
little. Anyway I don't have an idea how to implement this with ODB. Can 
you give me an advice? Any ideas?

Thank you in advance.



More information about the odb-users mailing list