query<T> abstract method

Future<List<T>> query<T>(
  1. BoundSql statement,
  2. T decode(
    1. SqlRow row
    )
)

Executes a row-returning statement and decodes every row in order.

Use this method for SELECT and dialect-supported statements containing RETURNING. The driver invokes decode exactly once per returned row. A non-null BoundSql.dialect must match the driver and is rejected before that statement reaches the database when it does not. The terminal is part of the caller contract: some database protocols only reveal the result shape after execution, so choosing the wrong terminal can still apply a statement's side effects before it is rejected.

Implementation

Future<List<T>> query<T>(BoundSql statement, T Function(SqlRow row) decode);