reset the last inserted id to 0 after it is saved

This commit is contained in:
Chris Cromer 2022-11-28 00:02:24 -03:00
parent 494080f303
commit 2ca55543ab
Signed by: cromer
GPG Key ID: FA91071797BEEEC2
3 changed files with 6 additions and 0 deletions

View File

@ -114,6 +114,8 @@ int obelisk::Entity::insertEntity(sqlite3* dbConnection)
setId((int) sqlite3_last_insert_rowid(dbConnection));
}
sqlite3_set_last_insert_rowid(dbConnection, 0);
result = sqlite3_finalize(ppStmt);
if (result != SQLITE_OK)
{

View File

@ -147,6 +147,8 @@ int obelisk::Fact::insertFact(sqlite3* dbConnection)
setId((int) sqlite3_last_insert_rowid(dbConnection));
}
sqlite3_set_last_insert_rowid(dbConnection, 0);
result = sqlite3_finalize(ppStmt);
if (result != SQLITE_OK)
{

View File

@ -117,6 +117,8 @@ int obelisk::Verb::insertVerb(sqlite3* dbConnection)
setId((int) sqlite3_last_insert_rowid(dbConnection));
}
sqlite3_set_last_insert_rowid(dbConnection, 0);
result = sqlite3_finalize(ppStmt);
if (result != SQLITE_OK)
{