haskell-beam / haskell-beam/beam
Modularize `BeamHasInsertOnConflict`
- Dominant language
- Haskell
- Stars
- 635
- Forks
- 193
- PR merge metrics
- No merged PRs in 30d
Description
[`BeamHasInsertOnConflict`](https://hackage-content.haskell.org/package/beam-core-0.11.0.0/docs/Database-Beam-Backend-SQL-BeamExtensions.html#t:BeamHasInsertOnConflict) is a typeclass with many methods. The central method is `insertOnConflict`, but others are also attached, such as `conflictingFieldsWhere`.
Unfortunately, not all methods are supported by all DB management systems. Specifically, `conflictingFieldsWhere` is supported by Postgres and SQLite, but not DuckDB. This creates the weird situation whereby the DuckDB backend can have a partial `BeamHasInsertOnConflict` instance (#808), but care must be taken to prevent the user from using `conflictingFieldsWhere`.
Instead, `BeamHasInsertOnConflict` should be modularized. I imagine that `insertOnConflict`, `anyConflict`, `onConflictDoNothing`, `onConflictUpdateSet` would be preserved on `BeamHasInsertOnConflict`, but other methods would be split off into other classes.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.