summaryrefslogtreecommitdiff
path: root/src/database/row.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/database/row.hpp')
-rw-r--r--src/database/row.hpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/database/row.hpp b/src/database/row.hpp
index 130863a..4dc98be 100644
--- a/src/database/row.hpp
+++ b/src/database/row.hpp
@@ -42,7 +42,8 @@ struct Row
if (id.value == Id::unset_value)
{
this->insert(*db);
- std::get<Id>(this->columns).value = db->last_inserted_rowid;
+ if (db->last_inserted_rowid >= 0)
+ std::get<Id>(this->columns).value = static_cast<Id::real_type>(db->last_inserted_rowid);
}
else
this->update(*db);