I play around with clojure and its korma library using an sqlite3 database on windows. I follow an example of the 7web book. It introduces the select* function and its friends.
But using the fields function adds fields instead of restricting.
;; models.clj
(defentity issue
(entity-fields :id :project_id :title :description :status)
(has-many comment))
;; repl
test=> (-> (select* issue)
#_=> (fields :title)
#_=> (as-sql))
"SELECT \"issue\".\"id\", \"issue\".\"project_id\", \"issue\".\"title\", \"issue\".\"description\", \"issue\".\"status\", \"issue\".\"title\" FROM \"issue\""
Did i miss anything?
Like mentioned in issue #251 the reason is the
entity-fieldsexpression. It defines the default fields for queries. Thefieldsfunction adds more fields to the defaults. Works as designed.Therefore I removed
entity-fieldswithindefentity.