forked from qt-creator/qt-creator
Sqlite: Relax LastChangedRowId
Change-Id: Ibc4637ebafd4c0cdedfcea5c52da5025435bc4ab Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
@@ -36,6 +36,29 @@ namespace Sqlite {
|
||||
class LastChangedRowId
|
||||
{
|
||||
public:
|
||||
LastChangedRowId(DatabaseInterface &database)
|
||||
: database(database)
|
||||
|
||||
{
|
||||
callback = [=](ChangeType, char const *database, char const *table, long long rowId) {
|
||||
this->lastRowId = rowId;
|
||||
};
|
||||
|
||||
database.setUpdateHook(callback);
|
||||
}
|
||||
|
||||
LastChangedRowId(DatabaseInterface &database, Utils::SmallStringView databaseName)
|
||||
: database(database)
|
||||
|
||||
{
|
||||
callback = [=](ChangeType, char const *database, char const *table, long long rowId) {
|
||||
if (databaseName == database)
|
||||
this->lastRowId = rowId;
|
||||
};
|
||||
|
||||
database.setUpdateHook(callback);
|
||||
}
|
||||
|
||||
LastChangedRowId(DatabaseInterface &database,
|
||||
Utils::SmallStringView databaseName,
|
||||
Utils::SmallStringView tableName)
|
||||
|
||||
Reference in New Issue
Block a user