Left join entity is never null
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 38/100
Research direction
No source file or test is named. Start by reproducing both query forms from the issue against SQLProvider v1.1.93, focusing on leftOuterJoin, DefaultIfEmpty(), and the reported default-valued entity. Done means documenting or testing the supported syntax and the expected missing-entity behavior.
Written by the indexing model from the issue text.
Description
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.
- Dominant language
- F#
- Stars
- 627
- Forks
- 147
- Avg merge
- 2h 2m
- Merged PRs (30d)
- 1
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from fsprojects/SQLProvider
-
enhancement
Difficulty 3/5 1-2 days Newbie friendliness 55/100
fsprojects/SQLProvider#872 · 2 comments ·
-
Repo Assist? Openenhancement
Difficulty 5/5 Over a week Newbie friendliness 10/100
fsprojects/SQLProvider#870 · 1 comment ·
-
postgresql
Difficulty 4/5 3-5 days Newbie friendliness 58/100
fsprojects/SQLProvider#869 · 2 comments ·
-
documentation
Difficulty 2/5 1-3 hours Newbie friendliness 42/100
fsprojects/SQLProvider#868 · 2 comments ·
-
sql server
Difficulty 4/5 3-5 days Newbie friendliness 45/100
fsprojects/SQLProvider#851 · 1 comment ·
All issues in fsprojects/SQLProvider
Similar issues
-
bug: AI Gateway client filter lists "Unknown" twice when NULL and literal Unknown clients coexist Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
-
[BUG] A column whose default is the empty string is drawn in the ER diagram as having no default Openbug database-provider good first issue hacktoberfest
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
libredb/libredb-studio#1030 · 6 comments ·
-
comp-datalake
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
ClickHouse/ClickHouse#121222 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
bug redshift
Difficulty 2/5 1-3 hours Newbie friendliness 88/100