 (defn del
   "Wrapper around `korma.core/delete` that makes it easier to delete a row given a single PK value.
    Returns a `204 (No Content)` response dictionary."
-  [entity & kwargs]
-  (delete entity (where (apply assoc {} kwargs)))
+  [entity & {:as kwargs}]
+  (delete entity (where kwargs))
   {:status 204
    :body nil})
 

   `(upd User 123 :is_active false)` -> updates user with id=123, setting is_active=false

   Returns true if update modified rows, false otherwise."
  [entity entity-id & kwargs]
  (let [kwargs (->> (apply assoc {} kwargs)
                    (pre-update entity))]
    (-> (update entity (set-fields kwargs) (where {:id entity-id}))
        (> 0))))

                        :fields str/upper-case}}))

(defn migrate
  "Migrate the database `:up` or `:down.`"
  [direction]
  (let [conn (jdbc/get-connection {:subprotocol "h2"
                                   :subname db-file})]
