I am using compojure, cheshire and korma (and postgre db) for creating a rest service. I've created a table with two string fields (name and description) with such structure:
(defentity posts
(pk :id)
(table :posts)
(entity-fields :name :description))
I can insert records into this table but when I try to exec
(defn get-all-posts []
(select posts))
and return the results from the server
defroutes app-routes
(GET "/" [] (get-start))
(context "/posts" []
(GET "/" [] (get-all-posts))
...
I receive such an error: java.lang.IllegalArgumentException No implementation of method: :render of protocol: #'compojure.response/Renderable found for class: clojure.lang.PersistentVector
As I see I need to convert posts collection to json. How to do it?