Left join entity is never null
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 38/100
Direzione di ricerca
Non sono indicati file sorgente né test. Inizia riproducendo entrambe le forme di query dell’issue con SQLProvider v1.1.93, concentrandoti su leftOuterJoin, DefaultIfEmpty() e sull’entità con valore predefinito segnalata. Il lavoro è completato quando la sintassi supportata e il comportamento previsto in caso di entità mancante sono documentati o testati.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- F#
- Stelle
- 627
- Fork
- 147
- Merge medio
- 2h 2m
- PR unite (30g)
- 1
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di fsprojects/SQLProvider
-
enhancement
Difficoltà 3/5 1-2 giorni Idoneità per principianti 55/100
fsprojects/SQLProvider#872 · 2 commenti ·
-
Repo Assist? Apertaenhancement
Difficoltà 5/5 Più di una settimana Idoneità per principianti 10/100
fsprojects/SQLProvider#870 · 1 commento ·
-
postgresql
Difficoltà 4/5 3-5 giorni Idoneità per principianti 58/100
fsprojects/SQLProvider#869 · 2 commenti ·
-
documentation
Difficoltà 2/5 1-3 ore Idoneità per principianti 42/100
fsprojects/SQLProvider#868 · 2 commenti ·
-
sql server
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
fsprojects/SQLProvider#851 · 1 commento ·
Tutte le issue di fsprojects/SQLProvider
Issue simili
-
[6.x]: "Cannot use object of type stdClass as array" loading Users index (regression of #19182) Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
community-scripts/ProxmoxVE#17396 · 1 commento ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
BasedHardware/omi#15274 · 3 commenti ·
-
bug: AI Gateway client filter lists "Unknown" twice when NULL and literal Unknown clients coexist Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 90/100
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100