OnConflict implementation for SQLite provider uses wrong feature of SQLite
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 35/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Estancado
- Stack tecnológico
- fsharp, sqlite
- Área
- databases
Línea de trabajo
El issue no menciona archivos ni tests; empieza por localizar la implementación actual de OnConflict del proveedor SQLite y leer la documentación enlazada de SQLite sobre ON CONFLICT y UPSERT. Compara el comportamiento con el de otros proveedores compatibles y con el caso NOT NULL indicado. Se considera terminado cuando el comportamiento elegido de SQLite, o su advertencia documentada, se haya acordado e implementado, teniendo en cuenta la compatibilidad hacia atrás.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Describe the bug
I think that implementation of OnConflict uses wrong feature of SQLite.
If you check the SQLite docs mentioned in https://fsprojects.github.io/SQLProvider/core/crud.html#OnConflict you'll see that "ON CONFLICT clause applies to UNIQUE, NOT NULL, CHECK, and PRIMARY KEY constraints".
SQLite has another feature, specifically for UPSERTs - https://sqlite.org/lang_upsert.html . Docs for that feature mention that "UPSERT in SQLite follows the syntax established by PostgreSQL, with generalizations."
I don't know why this feature of SQLite was chosen back in the day. Even though ON CONFLICT was available in SQLite for decades and UPSERT was only added at 2018, when this feature was added to SQLProvider UPSERT had already been available.
Nevertheless, I think it's quite confusing. Behavior of this feature for SQLite is different from other supported providers. I suppose we have two options:
- Fix SQLProvider implementation to use proper UPSERTS for SQLite, probably adding a configuration toggle somewhere to enable backward compatibility.
- Add a warning to the docs stating that usage of OnConflict feature for SQLite has a broader scope than one could expect.
In my case, I set OnConflict.Ignore to one of my tables, expecting it to only deal with primary key violations.
In the meantime, I had an error in my app, one of the non-null column hasn't been filled, but SQLite hasn't complained about it and just silently refused to insert a row into a table. At the end, by debugging raw sql I was able to figure things out.
- 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
-
bug: AI Gateway client filter lists "Unknown" twice when NULL and literal Unknown clients coexist Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 90/100
-
[BUG] A column whose default is the empty string is drawn in the ER diagram as having no default Abiertobug database-provider good first issue hacktoberfest
Dificultad 2/5 1-3 horas Aptitud para principiantes 90/100
libredb/libredb-studio#1030 · 6 comentarios ·
-
comp-datalake
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
ClickHouse/ClickHouse#121222 ·
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
-
bug redshift
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100