Closed rwomack closed 2 months ago
Yes, you can do a temp fix with renaming the variable long id
on line 1374 to count
and cast the long into the int and then make the SetAutoIncPK
to use the count instead of the long id.
Just as bellow:
if (map.HasAutoIncPK)
{
// long id = SQLite3.LastInsertRowid (Handle);
count = (int) SQLite3.LastInsertRowid (Handle);
// map.SetAutoIncPK (obj, id);
map.SetAutoIncPK (obj, count);
}
You will then get the auto incremented id
@Aresak Why introduce messy comments?
int primaryKey = 0;
if (map.HasAutoIncPK)
{
primaryKey = (int)SQLite3.LastInsertRowid (Handle);
map.SetAutoIncPK (obj, primaryKey);
}
return primaryKey;
connection.Insert(record) is always returning 1 not the auto incremented id, it appears to be returning RowsAffected from ExecuteNonQuery even though map.HasAutoIncPk is true and it updates the field?