Skip to content

Help with one-to-many query #3277

Closed Answered by dickermoshe
NatanAmorim asked this question in Q&A
Discussion options

You must be logged in to vote

The new manager API makes this easy.
You need the latest version of drift.

final results = await db.managers.users.withReferences((prefetch)=>prefetch(posts:true)).get();
for (final (user, ref) in results){
  posts = ref.posts.prefechedData;
}

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@NatanAmorim
Comment options

@NatanAmorim
Comment options

Answer selected by NatanAmorim
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants