You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

16 lines
492 B

#pragma once
#include <db/db.h>
#include <ical/IcalObject.h>
namespace db {
uint32_t insert_object(sql::Database *db, const ical::IcalObject *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;
}
}