diff options
Diffstat (limited to 'users/grfn/bbbg/src/bbbg/db/user.clj')
-rw-r--r-- | users/grfn/bbbg/src/bbbg/db/user.clj | 19 |
1 files changed, 0 insertions, 19 deletions
diff --git a/users/grfn/bbbg/src/bbbg/db/user.clj b/users/grfn/bbbg/src/bbbg/db/user.clj deleted file mode 100644 index 700105ef6350..000000000000 --- a/users/grfn/bbbg/src/bbbg/db/user.clj +++ /dev/null @@ -1,19 +0,0 @@ -(ns bbbg.db.user - (:require [bbbg.db :as db] - [bbbg.user :as user])) - -(defn create! [db attrs] - (db/insert! db - :public.user - (select-keys attrs [::user/id - ::user/username - ::user/discord-user-id]))) - -(defn find-or-create! [db attrs] - (or - (db/fetch db {:select [:*] - :from [:public.user] - :where [:= - :discord-user-id - (::user/discord-user-id attrs)]}) - (create! db attrs))) |