korma / Korma

Tasty SQL for Clojure.
http://sqlkorma.com
1.48k stars 222 forks source link

Quoted or unquoted strings #250

Closed martinskou closed 9 years ago

martinskou commented 9 years ago
(defentity thought
  (transform #(assoc % :tag-list (clojure.string/split (% :thought_tags) #"\s")))
  (database db))

(select thought) ; runs the transform as expected.
(select "thought") ; does not run the transform.

I understand why, but think the correct behaviour would be to check if any entities called "thought" exists and use this if it does, instead of just bypassing the defined entities alltogether.

immoh commented 9 years ago

Symbol thought refers to var created by defentity. Strings and keywords are treated as table names.