StreamedResults constructor

StreamedResults(
  1. int? insertId,
  2. int? affectedRows,
  3. List<Field> fields, {
  4. Stream<Row>? stream = null,
})

Implementation

factory StreamedResults(int? insertId, int? affectedRows, List<Field> fields, {Stream<Row>? stream = null}) {
  if (stream != null) {
    var newStream = stream.transform(StreamTransformer.fromHandlers(handleDone: (EventSink<Row> sink) {
      sink.close();
    }));
    return StreamedResults._fromStream(insertId, affectedRows, fields, newStream);
  } else {
    var newStream = Stream.fromIterable(<Row>[]);

    return StreamedResults._fromStream(insertId, affectedRows, fields, newStream);
  }
}