OnConflict implementation for SQLite provider uses wrong feature of SQLite
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 35/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- fsharp, sqlite
- 領域
- databases
調査の方向性
Issue にはファイルやテストが記載されていないため、まず SQLite provider の現在の OnConflict 実装を特定し、リンクされている SQLite の ON CONFLICT および UPSERT のドキュメントを読んでください。他のサポート対象 provider の動作と、報告されている NOT NULL のケースを比較してください。選択した SQLite の動作、またはその文書化された警告について合意し、実装したうえで、後方互換性を考慮できれば完了です。
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- F#
- スター
- 627
- フォーク
- 147
- 平均マージ
- 2時間 2分
- マージ済み PR(30日)
- 1
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
fsprojects/SQLProvider のほかの issue
-
enhancement
難易度 3/5 1〜2日 初心者へのやさしさ 55/100
fsprojects/SQLProvider#872 · コメント 2 件 ·
-
Repo Assist? オープンenhancement
難易度 5/5 1週間以上 初心者へのやさしさ 10/100
fsprojects/SQLProvider#870 · コメント 1 件 ·
-
postgresql
難易度 4/5 3〜5日 初心者へのやさしさ 58/100
fsprojects/SQLProvider#869 · コメント 2 件 ·
-
documentation
難易度 2/5 1〜3時間 初心者へのやさしさ 42/100
fsprojects/SQLProvider#868 · コメント 2 件 ·
-
sql server
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
fsprojects/SQLProvider#851 · コメント 1 件 ·
fsprojects/SQLProvider の issue をすべて見る
似ている issue
-
bug: AI Gateway client filter lists "Unknown" twice when NULL and literal Unknown clients coexist オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 90/100
-
[BUG] A column whose default is the empty string is drawn in the ER diagram as having no default オープンbug database-provider good first issue hacktoberfest
難易度 2/5 1〜3時間 初心者へのやさしさ 90/100
libredb/libredb-studio#1030 · コメント 6 件 ·
-
comp-datalake
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
ClickHouse/ClickHouse#121222 ·
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
bug redshift
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100