join data from 2 tables into one class

I need some database assistance.

I have the following tables:


I need to pull out an Event with the data from the EventType Table to assign and Event that has an EventType linked to a User.

I am using Moor and they cater for joins, I just need some assistance with the query. Currently I have been trying this:

Stream<EventWithType> eventWithType(EventData eventTypeId) {
  final query = select(event)
    ..where((tbl) {


class EventWithType {

  final EventData event;
  final EventTypeData eventTypeData;

  EventWithType(this.event, this.eventTypeData);

but I know I am doing something wrong I am just not sure how to do joins, or even if I am using the correct join?

TIA x10sion

Read more here:

Content Attribution

This content was originally published by x10sion at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: