|
@ -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; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |