From 8a40d50eeeebcd77ce64b1e40150f7dabf6e695a Mon Sep 17 00:00:00 2001 From: Evan Tatarka Date: Sat, 30 Jun 2018 20:59:52 -0400 Subject: [PATCH] Update README.md --- README.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 4535cb1..684d7f2 100644 --- a/README.md +++ b/README.md @@ -32,13 +32,16 @@ var streamDb = StreamDatabase(db); You can then listen to a query ```dart -var singleQuery = streamDb.createQuery("MyTable", where: 'id = ?', whereArgs: [id]) +// Emits a single row, doesn't emit if the row dosen't exist. +Stream singleQuery = streamDb.createQuery("MyTable", where: 'id = ?', whereArgs: [id]) .mapToOne((row) => MyEntry(row)); -var singleOrQuery = streamDb.createQuery("MyTable", where: 'id = ?', whereArgs: [id]) +// Emits a single row, or the given default value if the row doesn't exist. +Stream singleOrDefaultQuery = streamDb.createQuery("MyTable", where: 'id = ?', whereArgs: [id]) .mapToOneOrDefault((row) => MyEntry(row), MyEntry.empty()); -var listQuery = streamDb.createQuery("MyTable", where: 'name LIKE ?', whereArgs: [query]) +// Emits a list of rows. +Stream> listQuery = streamDb.createQuery("MyTable", where: 'name LIKE ?', whereArgs: [query]) .mapToList((row) => MyEntry(row)); var flexibleQuery = streamDb.createQuery("MyTable", where: 'name LIKE ?', whereArgs: [query])