metabase / toucan

A classy high-level Clojure library for defining application models and retrieving them from a DB
Eclipse Public License 1.0
570 stars 49 forks source link

Model instance to map #83

Closed eko234 closed 3 years ago

eko234 commented 3 years ago

hi @camsaul, I'm new to clojure, I'm trying to use toucan to build a rest api, but I can't find a way to respond to a request with a map that represents a record on my database, I have the following code:

(defn dbh [req]
  (let [user (User 3)]
    {:status 200
     :headers {"Content-Type" "application/json"}
     :body user  })) 

but when I make a request i just get what seems to me (I don't know clojure) like a sequence of pairs

[:id 3][:name "wayne"][:email "wayne@moon.com"][:password "ImFzZGFzZCI=.5lcSa6XsqitTjnXVD3BSGptcVbQ="]

could you please point me to the right direction to get a proper response?

eko234 commented 3 years ago

nvm, it has nothing to do with toucan.