-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: DbProvisionsStorage putMany doesnt error on cid col conflict (#517)
Motivation: * #482 * [x] first draft After 2023-03-09 review with @Gozala : * [x] add test for updating Provision with same invocation cid but different derived fields. it should result in error * [x] make test pass, probably by changing the kysely to be 'on conflict, do nothing as long as the derived columns are identical, otherwise error' * it wasn't really possible to do that on conflict logic as far as I could tell, at least through our `kysely` orm * kysely doesn't expose methods for all the [`on conflict` clauses that sqlite should support](https://www.sqlite.org/lang_conflict.html) * I pursued something like [this using CTE](https://stackoverflow.com/a/49601238), only to find out [sqlite doesn't support `insert` in cte](https://sqlite.org/forum/forumpost/b44ca81f043bed9f)
- Loading branch information
Showing
4 changed files
with
140 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters