Skip to content
Permalink
Browse files

fixed all-columns

  • Loading branch information...
Chris Zheng
Chris Zheng committed Dec 9, 2013
1 parent 630c43f commit a69205fa3b46f625f729c9fe916b95103609d749
Showing with 5 additions and 3 deletions.
  1. +1 −1 project.clj
  2. +4 −2 src/manas/core.clj
@@ -8,4 +8,4 @@
[mysql/mysql-connector-java "5.1.25"]
[lobos "1.0.0-beta1" :exclusions [org.clojure/java.jdbc]]]
:profiles {:dev {:dependencies [[midje "1.6.0"]]
:plugins [[lein-midje "3.1.3"]}})
:plugins [[lein-midje "3.1.3"]]}})
@@ -54,6 +54,8 @@
(false)
(str "drop database " (or schema (:database env)))))

(defn keywordize [x]
(if (keyword? x) x (keyword x)))

(defn ->table-entry [[k [t & args]]]
(concat [(symbol (str "lobos.schema/" (name t))) (keyword (name k))] args))
@@ -73,11 +75,11 @@

(defn all-columns [env table]
(with-connection (->subname env)
(-> (analyze-schema) :tables table :columns keys)))
(-> (analyze-schema) :tables (get (keywordize table)) :columns keys)))

(defn has-table? [env table]
(with-connection (->subname env)
(-> (analyze-schema) :tables table nil? not)))
(-> (analyze-schema) :tables (get (keywordize table)) nil? not)))

(defn create-table [env table columns]
(with-connection (->subname env)

0 comments on commit a69205f

Please sign in to comment.
You can’t perform that action at this time.