Hi, I'm getting an error calling a record from an id passed via a url using
Korma Sql. The error says:
org.postgresql.util.PSQLException
ERROR: operator does not exist: smallint = character varying Hint: No
operator matches the given name and argument type(s). You might need to add
explicit type casts. Position: 57
I have a list of members, with a url /member/:id to call profile for that
member in the view showing the member list. Here's my 3 moving parts:
ROUTE
(GET "/member/:id" [id] (get-the-member id))
FUNCTION
(defn get-the-member [id]
(layout/render
"member/profile.html"
{:member (db/get-member-url id)}))
MODEL
(defn get-member-url [id]
(first (select members
(where {:id id})
(limit 1))))
Now if I hard code the id number in the model, it works, but its not
accepting the id var as an integer. How would I give it an explicit
typecast in this instance. Or would it perhaps be better to use java.jdbc
or another ORM like Sql Lingov, HoneySQL, Clojureql or clojure-sql? Rest of
crud working fine, but id var not being accepted by the model. The model
itself works if an id number is hardcoded. Perhaps I'm missing some simple
syntax point here?
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to the Google Groups
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.