Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: queryCursorAsStream #42

Open
hoc081098 opened this issue Nov 2, 2022 · 0 comments
Open

feat: queryCursorAsStream #42

hoc081098 opened this issue Nov 2, 2022 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@hoc081098
Copy link
Owner

hoc081098 commented Nov 2, 2022

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(),
      );
@hoc081098 hoc081098 added the enhancement New feature or request label Nov 2, 2022
@hoc081098 hoc081098 self-assigned this Nov 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant