watchSingle method
Creates an auto-updating stream of this statement, similar to
watch. However, it is assumed that the query will only emit
one result, so instead of returning a Stream<List<D>>
, this returns a
Stream<D>
. If, at any point, the query emits no or more than one rows,
an error will be added to the stream instead.
The distinct
parameter (enabled by default) controls whether to generate
a SELECT DISTINCT
query, removing duplicates from the result.
Implementation
@override
Stream<$ActiveDataclass> watchSingle({bool distinct = true}) =>
watch(distinct: distinct).transform(singleElements());