Any users of vf::db out there? Since VFLib lacks documentation for the vf::db module, I’m trying got get started by following the SOCI documentation instead:
http://soci.sourceforge.net/doc/3.2/
I am, however facing some difficulties mapping the simple SOCI examples to vf::db.
First problem, opening the database. The following does not compile:
session sql("c:/mydatabase.db");
I figured I probably had to do it like this instead:
session sql;
sql.open("c:/mydatabase.db");
Then, running some queries. This does not compile:
int count;
sql << "select count(*) from phonebook", into(count);
DBG("We have " + String(count) + " entries in the phonebook.\n");
Due to:
Am I supposed to perform the queries like this instead? Via the get_query_stream()?
int count;
sql.get_query_stream() << "select count(*) from phonebook", into(count);
DBG("We have " + String(count) + " entries in the phonebook.\n");
This compiles, but fails to actually return any results from the database. I also tried other queries like inserting new rows into tables, but the database seems unaffected.
Please share any experience you might have with vf::db. Working code examples would be great!