Describe the bug
I am trying to left join "sheets" entity but I can't get it to work properly.
The documentation says that leftOuterJoin is not supported, but I see examples on stackoverflow of people saying this works.
For me it does not.
query {
for e in ctx.Dbo.TimeEntries do
join t in ctx.Dbo.ProjectTasks on (e.TaskId = t.Id)
leftOuterJoin sheet in ctx.Dbo.DrawingLogSheets on (e.SheetId = Some sheet.Id) into sheetResults
for s in sheetResults.DefaultIfEmpty() do
where (e.Email = Some email && e.Date = dateOnly)
select (toTimeEntry(e, t, s))
}
This fails with an error.
I also tried this approach:
query {
for e in ctx.Dbo.TimeEntries do
join t in ctx.Dbo.ProjectTasks on (e.TaskId = t.Id)
join s in (!!) ctx.Dbo.DrawingLogSheets on (e.SheetId = Some s.Id)
where (e.Email = Some email && e.Date = dateOnly)
select (toTimeEntry(e, t, s))
}
This kind of works, but sheet is never null when it is missing; instead, it has all its values defaulted. For example, its ID field is a new guid (all zeros), and its string values are all empty string. I suppose I could check for defaulted guid, but this just feels like something is not right.
To Reproduce
Expected behavior
In the first example (leftOuterJoin), I just want to verify whether this syntax is supposed to be supported or not.
In the second example (!!), I would expect the sheet entity to be null when no sheet is joined, but instead it is instantiated with all default values.
Screenshots
Desktop (please complete the following information):
Windows
SQLProvider is v1.1.93
Smartphone (please complete the following information):
Device: [e.g. iPhone6]
OS: [e.g. iOS8.1]
Browser [e.g. stock browser, safari]
Version [e.g. 22]
Additional context
Add any other context about the problem here.
Describe the bug I am trying to left join "sheets" entity but I can't get it to work properly.
The documentation says that leftOuterJoin is not supported, but I see examples on stackoverflow of people saying this works. For me it does not.
This fails with an error.
I also tried this approach:
This kind of works, but sheet is never null when it is missing; instead, it has all its values defaulted. For example, its ID field is a new guid (all zeros), and its string values are all empty string. I suppose I could check for defaulted guid, but this just feels like something is not right.
To Reproduce
Expected behavior In the first example (leftOuterJoin), I just want to verify whether this syntax is supposed to be supported or not. In the second example (!!), I would expect the sheet entity to be
null
when no sheet is joined, but instead it is instantiated with all default values.Screenshots
Desktop (please complete the following information):
Smartphone (please complete the following information):
Additional context Add any other context about the problem here.