Browse Source

store events to db

main
Stefan Pranger 3 years ago
parent
commit
c1928ee495
  1. 8
      db/update.h

8
db/update.h

@ -4,7 +4,13 @@
#include <ical/IcalObject.h> #include <ical/IcalObject.h>
namespace db { namespace db {
uint32_t insert_object(const sql::Database *db, const ical::IcalObject *object) {
uint32_t insert_object(sql::Database *db, const ical::IcalObject *object) {
DEBUG << *object; DEBUG << *object;
for(auto const& event : object->get_events()) {
stmt::Statement insert_object = stmt::Statement::insert().table("events").columns("uid, summary, dtstart, dtend").values().row(event->get_db_row()).close();
DEBUG << insert_object.str();
db->exec(insert_object.str());
}
return 0;
} }
} }
Loading…
Cancel
Save