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

Type Error on Unsafe Upsert Functions #868

Closed
parsonsmatt opened this issue Apr 2, 2019 · 0 comments
Closed

Type Error on Unsafe Upsert Functions #868

parsonsmatt opened this issue Apr 2, 2019 · 0 comments
Milestone

Comments

@parsonsmatt
Copy link
Collaborator

There are a couple of unsafe functions in persistent. It would be nice to fix them.

upsert fails at runtime if there isn't exactly one uniqueness constraint. We could have a type class UniqueUnique (or, probably better named, OnlyOneUnique) with valid instances being generated for entities that possess exactly one key. Other entities would instead have TypeError-laden instances. This moves failure from run-time to compile-time with very little cost to end users.

@parsonsmatt parsonsmatt added this to the 3.0 milestone Apr 2, 2019
@parsonsmatt parsonsmatt mentioned this issue Apr 11, 2019
5 tasks
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