doUpdateSQL method
FutureOr
doUpdateSQL(
- String entityName,
- String table,
- SQL sql,
- Object id,
- Transaction transaction,
- DBMySqlConnectionWrapper connection, {
- bool allowAutoInsert = false,
override
Implementation
@override
FutureOr doUpdateSQL(
String entityName,
String table,
SQL sql,
Object id,
Transaction transaction,
DBMySqlConnectionWrapper connection, {
bool allowAutoInsert = false,
}) {
if (sql.isDummy) return id;
return connection
.query(sql.sqlPositional, sql.parametersValuesByPosition)
.resolveMapped((results) {
var affectedRows = results.affectedRows;
if (affectedRows == 0) {
return autoInsertAfterNoopUpdate(
transaction,
entityName,
table,
sql,
connection,
allowAutoInsert: allowAutoInsert,
logger: _log,
);
}
return _resolveResultID(results, table, sql, id);
});
}