-
Notifications
You must be signed in to change notification settings - Fork 88
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
11180e7
commit c7ddaa3
Showing
10 changed files
with
119 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
5 changes: 3 additions & 2 deletions
5
source/examples/generated/flutter/backlinks_test.snippet.filter-backlinks-rql.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
// Filter tasks through the User's backlink property | ||
// Filter Tasks through the User's backlink property | ||
// using `@links.<ObjectType>.<PropertyName>` syntax | ||
final jarjarsIncompleteTasks = realm.query<Task>( | ||
"ALL @links.User.tasks.username == 'jarjar_binks' AND isComplete == false"); | ||
|
||
final tasksForHan = realm.query<Task>("ALL @links.User.tasks.username == 'han'"); | ||
final tasksForHan = | ||
realm.query<Task>("ALL @links.User.tasks.username == 'han'"); |
10 changes: 10 additions & 0 deletions
10
...xamples/generated/flutter/backlinks_test.snippet.query-backlink-inverse-relationship.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// Tasks have an inverse relationship to Users | ||
final inCompleteTasks = realm.query<Task>("isComplete == false"); | ||
|
||
// Find all Users who have an incomplete Task | ||
for (final task in inCompleteTasks) { | ||
final ownersWithIncompleteTasks = task.getBacklinks<User>('tasks'); | ||
for (final user in ownersWithIncompleteTasks) { | ||
print("User ${user.username} has incomplete tasks."); | ||
} | ||
} |
3 changes: 2 additions & 1 deletion
3
...cklinks_test.snippet.query-backlinks.dart → ...t.query-backlink-to-one-relationship.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
// Persons have a to-one relationship with Bikes | ||
final person = realm.query<Person>("firstName == 'Anakin'").first; | ||
|
||
// Find all bikes that have an owner named Anakin | ||
// Find all Bikes that have an Owner named 'Anakin' | ||
final allBikes = person.getBacklinks<Bike>('owner'); |
6 changes: 6 additions & 0 deletions
6
...amples/generated/flutter/backlinks_test.snippet.query-backlinks-to-many-relationship.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
// Scooters have a to-many relationship with ScooterShops | ||
final scooters = realm.query<Scooter>("name == 'Scooterbug'").first; | ||
|
||
// Find all ScooterShops that sell the Scooterbug | ||
final shops = scooters.getBacklinks<ScooterShop>('scooters'); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters