Improve the db api efficiency

Mainly setup proper defaults and reduce unnecesary allocations
on every db api call.
This commit is contained in:
Andrey Antukh 2024-01-02 21:41:49 +01:00
parent 93bf8c1478
commit 746d898245
28 changed files with 228 additions and 186 deletions

View file

@ -133,7 +133,8 @@
(update-password [conn profile-id]
(let [pwd (profile/derive-password cfg password)]
(db/update! conn :profile {:password pwd} {:id profile-id})))]
(db/update! conn :profile {:password pwd} {:id profile-id})
nil))]
(db/with-atomic [conn pool]
(->> (validate-token token)
@ -303,7 +304,8 @@
(-> (db/update! conn :profile
{:default-team-id (:id team)
:default-project-id (:default-project-id team)}
{:id id})
{:id id}
{::db/return-keys true})
(profile/decode-row))))