Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Left join entity is never null

Abierto
#697 2 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
38/100
Tipo de issue
Error
Claridad
Necesita aclaración
Estado de actividad
Tranquilo
Stack tecnológico
fsharp, sql
Área
databases

Línea de trabajo

No se indica ningún archivo fuente ni ninguna prueba. Empieza reproduciendo ambas formas de consulta del issue contra SQLProvider v1.1.93, centrándote en leftOuterJoin, DefaultIfEmpty() y la entidad con valor predeterminado indicada. Se considera hecho documentar o probar la sintaxis compatible y el comportamiento esperado cuando falta la entidad.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
F#
Estrellas
627
Forks
147
Merge medio
2 h 2 min
PR fusionados (30 d)
1

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de fsprojects/SQLProvider

Todos los issues de fsprojects/SQLProvider

Issues similares

Más issues de Databases

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.