Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

upsertWhere in Database.Persist.Postgresql has too strict a type signature #1489

Open
Vlix opened this issue Apr 21, 2023 · 1 comment
Open

Comments

@Vlix
Copy link
Contributor

Vlix commented Apr 21, 2023

The constraints for upsertWhere are as follows:

( backend ~ PersistEntityBackend record
, PersistEntity record
, PersistEntityBackend record ~ SqlBackend
, MonadIO m
, PersistStore backend
, BackendCompatible SqlBackend backend
, OnlyOneUniqueKey record
) =>

But as you might notice, it's saying BackendCompatible SqlBackend backend AND backend ~ SqlBackend (via a small detour using PersistEntityBackend record).
So it's basically just saying the backend HAS to be SqlBackend. I believe this should be able to be loosened (so we can use our own backend)

At first glance, I think the backend ~ PersistEntityBackend record is the only unnecessary constraint. 🤔

@Vlix
Copy link
Contributor Author

Vlix commented Apr 21, 2023

This of course also applies to upsertManyWhere

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant