Skip to content

Instantly share code, notes, and snippets.

@boxxxie
Created November 2, 2011 20:13
Show Gist options
  • Save boxxxie/1334752 to your computer and use it in GitHub Desktop.
Save boxxxie/1334752 to your computer and use it in GitHub Desktop.
always returns :false-false no matter if the DBs exist or not (:false-false is when they both don't exist)
(defmulti statsTransform
(fn [fromDB toDB]
(let [dbs (db/all-databases)
fromDB? (some #(= % fromDB) dbs)
toDB? (some #(= % toDB) dbs)]
(swank.core/break)
[fromDB? toDB?])))
(defmethod statsTransform [true true] [from to] :rect-shape)
(defmethod statsTransform [true false] [from to]
(create-transformation-db to))
(defmethod statsTransform [false false] [from to] :false-false)
(defmethod statsTransform [false true] [from to] :shape-rect)
(defn -statsTransform [fromDB toDB]
(statsTransform fromDB toDB))
(-statsTransform "media_stats" "t_media_stats")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment