SqlExp and SqlQuery
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 25/100
Línea de trabajo
Comienza revisando las definiciones de SqlExp y SqlQuery en el issue y los esfuerzos existentes para analizar consultas SQL en estructuras de datos de F#. Determina si uno de esos modelos puede representar los ejemplos de ordenamiento y seguir generando SQL; se considera terminado cuando el modelo elegido maneja estas formas complejas de consulta sin la discrepancia en tiempo de ejecución documentada.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
We are currently modelling our SQL-expressions with quite simple context:
SqlExp =
| BaseTable of alias * Table // name of the initiating IQueryable table - this isn't always the ultimate table that is selected
| SelectMany of alias * alias * SelectData * SqlExp // from alias, to alias and join data including to and from table names. Note both the select many and join syntax end up here
| FilterClause of Condition * SqlExp // filters from the where clause(es)
| HavingClause of Condition * SqlExp // filters from the where clause(es)
| Projection of Expression * SqlExp // entire LINQ projection expression tree
| Distinct of SqlExp // distinct indicator
| OrderBy of alias * string * bool * SqlExp // alias and column name, bool indicates ascending sort
| Union of bool * string * SqlExp // true = "union all", false = "union", and subquery
| Skip of int * SqlExp
| Take of int * SqlExp
| Count of SqlExp
| AggregateOp of AggregateOperation * alias * string * SqlExp
and SqlQuery =
{ Filters : Condition list
HavingFilters : Condition list
Links : (alias * LinkData * alias) list
Aliases : Map<string, Table>
Ordering : (alias * string * bool) list
Projection : Expression list
Grouping : (list<alias * string> * list<AggregateOperation * alias * string>) list //key columns, aggregate columns
Distinct : bool
UltimateChild : (string * Table) option
Skip : int option
Take : int option
Union : (bool*string) option
Count : bool
AggregateOp : (AggregateOperation * alias * string) list }
The problem is that we will fail more complex SQL:s, e.g. if you have multiple items like Skips:
select x from xs
skip 1
skip 1
take 1
That code should take 3 from [1;2;3;4] but actually would take 2, but we know this and fail runtime. But then again, the SQL can be more weird, where we can't fail but we expect the typical execution order while the real results should be something else:
select x from xs
take 5
where x > 3
join y in ys
We use our model to generate model -> SQL. There are multiple efforts to do the other way, parse SQL-queries to F# data structures SQL -> model.
Could we, instead of having our own model, steal some model from those efforts, and reverse the functionality to generate SQL?
- 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
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de fsprojects/SQLProvider
-
enhancement
Dificultad 3/5 1-2 días Aptitud para principiantes 55/100
fsprojects/SQLProvider#872 · 2 comentarios ·
-
Repo Assist? Abiertoenhancement
Dificultad 5/5 Más de una semana Aptitud para principiantes 10/100
fsprojects/SQLProvider#870 · 1 comentario ·
-
postgresql
Dificultad 4/5 3-5 días Aptitud para principiantes 58/100
fsprojects/SQLProvider#869 · 2 comentarios ·
-
documentation
Dificultad 2/5 1-3 horas Aptitud para principiantes 42/100
fsprojects/SQLProvider#868 · 2 comentarios ·
-
sql server
Dificultad 4/5 3-5 días Aptitud para principiantes 45/100
fsprojects/SQLProvider#851 · 1 comentario ·
Todos los issues de fsprojects/SQLProvider
Issues similares
-
Edit: CW+ Abiertochannels:edit check:passed
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
-
Area/ICP Type/Bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
wso2/product-integrator#2514 ·
-
[6.x]: "Cannot use object of type stdClass as array" loading Users index (regression of #19182) Abierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 90/100
-
[InvoiceShelf] No database info Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
community-scripts/ProxmoxVE#17396 · 1 comentario ·
-
bug possible-duplicate
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
AOSSIE-Org/PictoPy#1553 · 4 comentarios ·