I have a simple update statement:
-- name: add-response!
UPDATE survey
SET :question = :response
WHERE caseid = :caseid
And I invoke it like this:
(add-response! db-spec "q1" 2 1001)
However, yesql doesn't like using a string as a parameter for the column - it translates "q1" to 'q1', which isn't valid postgres syntax.
"BatchUpdateException Batch entry 0 UPDATE survey SET 'q1' = 2
WHERE caseid = 1001 was aborted."
Is there a way to make this work? I've tried using the question name as a symbol: 'q1. That doesn't work because:
"PSQLException Can't infer the SQL type to use for an instance of clojure.lang.Symbol."