#include #include #include int main() { StderrLog log; Database db("tutorial.db", &log); // sqlite3 specific // create a new entry db::Player empty(&db); empty.name = "Ineptus"; empty.save(); // insert because it's a new object // modify the entry db::Player Ineptus(db, "Ineptus"); Ineptus.name = "Veterano"; Ineptus.save(); // update because this is an existing object // delete db::Player lorangrym(db, "Lorangrym"); if (lorangrym.num) { Query q(db); char sql[1000]; sprintf(sql, "delete from playerresource where player=%ld", lorangrym.num); q.execute(sql); lorangrym.erase(); } }