diff --git a/src/metabase/db.clj b/src/metabase/db.clj index 532c96817f20f007e31e47f87f8a41a57f7e4532..1543ca4a64fd560dc30fb40d578a6747cc1ce451 100644 --- a/src/metabase/db.clj +++ b/src/metabase/db.clj @@ -288,19 +288,15 @@ ;; ## EXISTS? -(defn -exists? - [entity kwargs] - (boolean (seq (k/select (i/entity->korma entity) - (k/fields [:id]) - (k/where kwargs) - (k/limit 1))))) - (defmacro exists? "Easy way to see if something exists in the db. (exists? User :id 100)" [entity & {:as kwargs}] - `(-exists? ~entity '~(if (seq kwargs) kwargs {}))) + `(boolean (seq (k/select (i/entity->korma ~entity) + (k/fields [:id]) + (k/where ~(if (seq kwargs) kwargs {})) + (k/limit 1))))) ;; ## CASADE-DELETE