mapToOne<T> method

Stream<T> mapToOne<T>(
  1. T rowMapper(
    1. JSON row
    )
)

Given a function mapping the current row to T, transform each emitted Query which returns a single row to T.

It is an StateError for a query to pass through this operator with more than 1 row in its result set. Use LIMIT 1 on the underlying SQL query to prevent this. Emits a StateError when result sets has 0 rows.

Implementation

Stream<T> mapToOne<T>(T Function(JSON row) rowMapper) =>
    _queryToOneStreamTransformer(this, rowMapper, null);