C++/sqlite wrapper for dead-easy class serialization?

There no easy C++ ORM (Object relational Mapping) tools. The two libraries I know of that ease the process are :

  • SOCI
  • Debea

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 the nearly inexistent 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.


Quince is a library that does almost exactly what the questioner asks for. See quince-lib.com.

(Full disclosure: I wrote it.)


This questions was asked a while ago. Since then, Hiberlite has been developed, and purports to do almost exactly what you are asking for.

It does not support reading/writing with << and >> (Boost.serialization does, as others have mentioned, but it does not store in an SQL DB); however, using it seems to be easy enough.