run method

Future<int> run(
  1. MySqlConnection connection
)

Implementation

Future<int> run(MySqlConnection connection) async {
  int affectedRows = 0;
  await connection.transaction((ctx) async {
    var sql = compile();
    Results? result = await ctx.query(sql).catchError((e) {
      _log.severe('Failed to run query: [ $sql ]', e);
      throw e;
    });
    affectedRows = result.affectedRows ?? 0;
  });

  return affectedRows;
}