-
Notifications
You must be signed in to change notification settings - Fork 553
Closed
Labels
Description
Hi,
How i can get the number of affected rows for update/delete?
Example:
auto sql =
"UPDATE todo SET "
"title = :title, "
"body = :body, "
"data = :data, "
"done = :done, "
"updated_at = :updated_at "
"WHERE id = :id";
auto application = std::static_pointer_cast<ApplicationCoreImpl>(ApplicationCore::shared());
auto db = application->getDB();
SQLite::Statement query(*db, sql);
query.bind(":id", id);
query.bind(":title", todo.title);
query.bind(":body", todo.body);
query.bind(":data", MapHelper::toJsonString(todo.data));
query.bind(":done", todo.done);
query.bind(":updated_at", DateTime::getStringFromDateTime(todo.updatedAt));
query.exec();
Thanks.