Improve options handling on db module

This commit is contained in:
Andrey Antukh 2023-11-30 13:11:36 +01:00 committed by Andrés Moya
parent 6bff6d24b9
commit 0a77bae8a7
5 changed files with 41 additions and 23 deletions

View file

@ -899,7 +899,7 @@
(assoc :file-id file-id)
(d/update-when :media-id lookup-index)
(d/update-when :thumbnail-id lookup-index))
{:on-conflict-do-nothing overwrite?}))))
{::db/on-conflict-do-nothing? overwrite?}))))
(doseq [item (:thumbnails @*state*)]
(let [item (update item :media-id lookup-index)]
@ -909,7 +909,7 @@
:object-id (:object-id item)
::l/sync? true)
(db/insert! conn :file-tagged-object-thumbnail item
{:on-conflict-do-nothing overwrite?})))))
{::db/on-conflict-do-nothing? overwrite?})))))
(defn- lookup-index
[id]

View file

@ -729,7 +729,8 @@
(role->params role))]
;; Insert the invited member to the team
(db/insert! conn :team-profile-rel params {:on-conflict-do-nothing true})
(db/insert! conn :team-profile-rel params
{::db/on-conflict-do-nothing? true})
;; If profile is not yet verified, mark it as verified because
;; accepting an invitation link serves as verification.

View file

@ -105,7 +105,7 @@
::quotes/team-id team-id})
;; Insert the invited member to the team
(db/insert! conn :team-profile-rel params {:on-conflict-do-nothing true})
(db/insert! conn :team-profile-rel params {::db/on-conflict-do-nothing? true})
;; If profile is not yet verified, mark it as verified because
;; accepting an invitation link serves as verification.