Comments (4)
The extended error:
1. Unhandled org.postgresql.util.PSQLException
ERROR: syntax error at or near "$1" Position: 23
QueryExecutorImpl.java: 2182 org.postgresql.core.v3.QueryExecutorImpl/receiveErrorResponse
QueryExecutorImpl.java: 1911 org.postgresql.core.v3.QueryExecutorImpl/processResults
QueryExecutorImpl.java: 173 org.postgresql.core.v3.QueryExecutorImpl/execute
AbstractJdbc2Statement.java: 645 org.postgresql.jdbc2.AbstractJdbc2Statement/execute
AbstractJdbc2Statement.java: 495 org.postgresql.jdbc2.AbstractJdbc2Statement/executeWithFlags
AbstractJdbc2Statement.java: 380 org.postgresql.jdbc2.AbstractJdbc2Statement/executeQuery
ProxyPreparedStatement.java: 52 com.zaxxer.hikari.pool.ProxyPreparedStatement/executeQuery
HikariProxyPreparedStatement.java: -1 com.zaxxer.hikari.pool.HikariProxyPreparedStatement/executeQuery
jdbc.clj: 845 clojure.java.jdbc/db-query-with-resultset/run-query-with-params
jdbc.clj: 859 clojure.java.jdbc/db-query-with-resultset
jdbc.clj: 817 clojure.java.jdbc/db-query-with-resultset
jdbc.clj: 882 clojure.java.jdbc/query
jdbc.clj: 863 clojure.java.jdbc/query
jdbc.clj: 876 clojure.java.jdbc/query
jdbc.clj: 863 clojure.java.jdbc/query
AFn.java: 156 clojure.lang.AFn/applyToHelper
AFn.java: 144 clojure.lang.AFn/applyTo
core.clj: 650 clojure.core/apply
core.clj: 641 clojure.core/apply
clojure_java_jdbc.clj: 15 hugsql.adapter.clojure-java-jdbc.HugsqlAdapterClojureJavaJdbc/query
adapter.clj: 3 hugsql.adapter/eval22550/fn/G
adapter.clj: 3 hugsql.adapter/eval22550/fn/G
Var.java: 394 clojure.lang.Var/invoke
core.clj: 463 hugsql.core/db-fn*/y
RestFn.java: 445 clojure.lang.RestFn/invoke
core.clj: 453 hugsql.core/db-fn*/y
REPL: 295 dev/eval58869
REPL: 295 dev/eval58869
Compiler.java: 6927 clojure.lang.Compiler/eval
Compiler.java: 6890 clojure.lang.Compiler/eval
core.clj: 3105 clojure.core/eval
core.clj: 3101 clojure.core/eval
main.clj: 240 clojure.main/repl/read-eval-print/fn
main.clj: 240 clojure.main/repl/read-eval-print
main.clj: 258 clojure.main/repl/fn
main.clj: 258 clojure.main/repl
main.clj: 174 clojure.main/repl
RestFn.java: 1523 clojure.lang.RestFn/invoke
interruptible_eval.clj: 87 clojure.tools.nrepl.middleware.interruptible-eval/evaluate/fn
AFn.java: 152 clojure.lang.AFn/applyToHelper
AFn.java: 144 clojure.lang.AFn/applyTo
core.clj: 646 clojure.core/apply
core.clj: 1881 clojure.core/with-bindings*
core.clj: 1881 clojure.core/with-bindings*
RestFn.java: 425 clojure.lang.RestFn/invoke
interruptible_eval.clj: 85 clojure.tools.nrepl.middleware.interruptible-eval/evaluate
interruptible_eval.clj: 55 clojure.tools.nrepl.middleware.interruptible-eval/evaluate
interruptible_eval.clj: 222 clojure.tools.nrepl.middleware.interruptible-eval/interruptible-eval/fn/fn
interruptible_eval.clj: 190 clojure.tools.nrepl.middleware.interruptible-eval/run-next/fn
AFn.java: 22 clojure.lang.AFn/run
ThreadPoolExecutor.java: 1142 java.util.concurrent.ThreadPoolExecutor/runWorker
ThreadPoolExecutor.java: 617 java.util.concurrent.ThreadPoolExecutor$Worker/run
Thread.java: 745 java.lang.Thread/run
from hugsql.
The error is obscured but it is actually the same in jdbc. The only nice thing is that with (clojure.java.jdbc/print-sql-exception-chain *e)
I get the actual sql statement.
BatchUpdateException:
Message: Batch entry 0 UPDATE workflows
SET ('error_count','scan_right') = (22,'{"url":"http://lorempixel.com/640/480/cats/test-545","side":"right","volume":4}')
WHERE id = 5
RETURNING * was aborted. Call getNextException to see the cause.
SQLState: 42601
Error Code: 0
PSQLException:
Message: ERROR: syntax error at or near "$1"
Position: 23
SQLState: 42601
Error Code: 0
This led me to the error. As you can see, the column are quoted, which I did not expect but makes sense (they are strings after all). So for column names I actually need something different from :tuple
probably.
from hugsql.
And the winner is :i*
!
-- :name update-workflow! :<! :1
-- :doc update an existing workflow's fields
UPDATE workflows
SET (:i*:cols) = :tuple:vals
WHERE id = :id
RETURNING *
from hugsql.
Glad you figured it out! I'm @curtissummers
on the clojurians slack.
from hugsql.
Related Issues (20)
- Way to get generated SQL without executing? HOT 1
- Add support for next.jdbc.sql/insert-multi! HOT 1
- Avoid calling apply in 'hugsql.adapter.clojure-java-jdbc' HOT 5
- Incorrect Arities Shown in Docs for def-fb-fns HOT 1
- HugSql fails during AOT compilation with depstar HOT 4
- Switch to newer groupId of next.jdbc dependency in hugsql-adapter-next-jdbc HOT 1
- How to use a function from the database? HOT 2
- Migration fails if a comment is present on line with semicolon HOT 2
- Babashka support HOT 2
- No comments in doc on mobile? HOT 1
- Using classpath resource sql functions breaks cider HOT 3
- Hugsql 0.5.3 still requires SQL files on uberjar compilation (with leiningen) HOT 1
- strange key with jsonb HOT 3
- Should hugsql switch to next.jdbc by default ? HOT 2
- Cannot look up by UUID HOT 2
- Bulk update? HOT 1
- Inline parameters
- Doesn't work with AOT compilation
- Migrations DSL HOT 2
- Non positional insert-multi HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hugsql.