Skip to content

feat: queryCursorAsStream #42

@hoc081098

Description

@hoc081098

ReactiveX/rxdart#696

Stream<JSON> queryCursorAsStream(
    String table, {
    bool? distinct,
    List<String>? columns,
    String? where,
    List<Object?>? whereArgs,
    String? groupBy,
    String? having,
    String? orderBy,
    int? limit,
    int? offset,
    int? bufferSize,
  }) =>
      Rx.using<JSON, sqlite_api.QueryCursor>(
        () => queryCursor(
          table,
          distinct: distinct,
          columns: columns,
          where: where,
          whereArgs: whereArgs,
          groupBy: groupBy,
          having: having,
          orderBy: orderBy,
          limit: limit,
          offset: offset,
          bufferSize: bufferSize,
        ),
        (cursor) async* {
          while (await cursor.moveNext()) {
            yield cursor.current;
          }
        },
        (cursor) => cursor.close(),
      );

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions