From a3109b4a6bce7e9d55dc76d195a1c53cef03d970 Mon Sep 17 00:00:00 2001 From: Simon Binder Date: Tue, 12 Jul 2022 17:52:04 +0200 Subject: [PATCH] Fix query in example app --- examples/app/lib/database/database.dart | 5 +++-- examples/app/lib/database/database.g.dart | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/examples/app/lib/database/database.dart b/examples/app/lib/database/database.dart index 41760518..8178b02e 100644 --- a/examples/app/lib/database/database.dart +++ b/examples/app/lib/database/database.dart @@ -76,8 +76,9 @@ class AppDatabase extends _$AppDatabase { /// Returns an auto-updating stream of all todo entries in a given category /// id. Stream> entriesInCategory(int? categoryId) { - final query = select(todoEntries).join( - [leftOuterJoin(categories, categories.id.equalsExp(todoEntries.id))]); + final query = select(todoEntries).join([ + leftOuterJoin(categories, categories.id.equalsExp(todoEntries.category)) + ]); if (categoryId != null) { query.where(categories.id.equals(categoryId)); diff --git a/examples/app/lib/database/database.g.dart b/examples/app/lib/database/database.g.dart index 5e31a258..ed32d3bd 100644 --- a/examples/app/lib/database/database.g.dart +++ b/examples/app/lib/database/database.g.dart @@ -3,7 +3,7 @@ part of 'database.dart'; // ************************************************************************** -// MoorGenerator +// DriftDatabaseGenerator // ************************************************************************** // ignore_for_file: type=lint @@ -655,7 +655,7 @@ abstract class _$AppDatabase extends GeneratedDatabase { Selectable _search(String query) { return customSelect( - 'SELECT"todos"."id" AS "nested_0.id", "todos"."description" AS "nested_0.description", "todos"."category" AS "nested_0.category", "todos"."due_date" AS "nested_0.due_date","cat"."id" AS "nested_1.id", "cat"."name" AS "nested_1.name", "cat"."color" AS "nested_1.color" FROM text_entries INNER JOIN todo_entries AS todos ON todos.id = text_entries."rowid" LEFT OUTER JOIN categories AS cat ON cat.id = todos.category WHERE text_entries MATCH @1 ORDER BY rank', + 'SELECT"todos"."id" AS "nested_0.id", "todos"."description" AS "nested_0.description", "todos"."category" AS "nested_0.category", "todos"."due_date" AS "nested_0.due_date","cat"."id" AS "nested_1.id", "cat"."name" AS "nested_1.name", "cat"."color" AS "nested_1.color" FROM text_entries INNER JOIN todo_entries AS todos ON todos.id = text_entries."rowid" LEFT OUTER JOIN categories AS cat ON cat.id = todos.category WHERE text_entries MATCH ?1 ORDER BY rank', variables: [ Variable(query) ],