I am looking for an OO sqlite C++ wrapper which allows quasi-transparent serialization and de-serialization of classes.
The work-flow I have in mind is as follow:
- define a class record with the data members
- Supply this class to the wrapper which creates a suitable table
Simple serialization and de-serialization via << and >> for the entire class.
Is this realistic or do I necessarily have to write the operators myself? Ideally I would like to not worry about how the data gets into the database and how it is stored… Ease of use is my main concern rather than flexibility or performance.
I am looking for something along the lines of the GAE datastore python interface.
Many thanks,
Arik
There’s no easy C++ ORM (Object Relational Mapping) tools. The two libraries I know of that ease the process are :
SOCI is simpler and is boost-like in philosophy, while debea is more ORM oriented.
By the way, if SQLite / SQL / requests are not mandatory, you can use Boost serialization framework.
Just my two cents
EDIT:
Well, given C++ reflection possibilities, my humble opinion is that the only way to do what you want to do is to use a code generator. Given that there was no decent, easy to use C++ parser/lexer/…, I know of none widespread tool doing that.
Someone I know had the same problem for some years. He has finally found a solution : He tells me that clang is now usable (it compiles boost), and that he uses it to generate serialization code based upon markers in the code (he tells me that there is support for marker in TR1, but I’m no expert). That is valuable feedback, and my own tries in this field make me agree about the solution.