run method

Future<int> run(
  1. PostgreSQLConnection connection
)

Implementation

Future<int> run(PostgreSQLConnection connection) async {
  //return connection.execute(compile());
  var result = await connection.transaction((ctx) async {
    var sql = compile();
    var result = await ctx.query(sql).catchError((e) {
      _log.severe('Failed to run query: [ $sql ]', e);
    });
    return result.affectedRowCount;
  });

  return (result is int) ? result : 0;
}