This worked for me, with mysql 5.1 on Ubuntu Natty. The clojure_test
library and fruit table already existed.
(ns foo.core
(use [korma.db])
(use [korma.core]))
(defdb mydb {:subprotocol "mysql"
:subname "//127.0.0.1:3306/clojure_test"
:user "clojure_test"
My mistake in the original post - that should've read (sql/defenity
mytable)
Two seprate forms - the defentity + the select.
On Nov 4, 3:21 pm, Base wrote:
> Did you mean to define the select within the defentity?
>
> (sql/defentity mytable (sql/select mytable (sql/fields :id) (sql/
> where {:
Actually it should read:
(sql/defentity mytable
(:pk <<< YOUR PRIMARY KEY AS A KEYWORD>>>)
(sql/table <<>>)
(sql/database devdb))
(sql/select mytable (sql/fields :id) (sql/where {:id 1}))
On Nov 4, 3:21 pm, Base wrote:
> Did you mean to define the select within the defentity?
>
> (sql/d
Did you mean to define the select within the defentity?
(sql/defentity mytable (sql/select mytable (sql/fields :id) (sql/
where {:id 1})))
I does this work?
(sql/defentity mytable
(:pk <<< YOUR PRIMARY KEY AS A KEYWORD>>>)
(table <<>>)
(database devdb))
(sql/select mytable (sql/fields :
I believe I have setup korma correctly with
(require '[korma.db :as db])
(require '[korma.core :as sql])
(db/defdb devdb (db/mysql {:db "mydb" :host "localhost" :user
"me" :password "mypass"}))
(sql/defentity mytable
(sql/select mytable (sql/fields :id) (sql/where {:id 1})))
But I'm getting
SQLExc