sqlite_modern_cpp
sqlite_modern_cpp copied to clipboard
[question] about data update wrapper
How many rows has modified by an update command? What value when auto_increment of primary key after inserted?
Assuming sqlite::database db(...);:
How many rows has modified by an update command?
auto changed = db.rows_modified();
What value when auto_increment of primary key after inserted? If the primary key is a INTEGER PRIMARY KEY (aka an alias for the rowid), then you can use
auto last_id = db.last_insert_rowid();
Otherwise I don't think that sqlite makes that information available. (But if you want to use an auto_increment primary key you normally want to make it a rowid alias anyway)
Thank's, I'll try.