Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I am more of Scheme guy and always feel Lisp is pretty overwhelming, but this looks quite clean. I like the little language for writing HTML.


But this looks like a sql injection awaiting to happen:

    (defn inc! [id]
      (kc/exec-raw (format "UPDATE articles SET count = count + 1 WHERE id = %s" id)))

(From https://github.com/tbsschroeder/clojure-webshop-app/blob/mas...) You don't need format it seems: https://github.com/korma/Korma/blob/master/src/korma/core.cl...


sanitizing SQL queries is just as simple in Clojure as in any other language (maybe more so), even if it wasn't done in this example.


It looks like it is builtin even in the library he uses. So not sure why he chooses format.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: