Comments (5)
Hmm. Are you saying HugSQL is not leaving your double-quotes alone? I'm not seeing that:
=> (hugsql/sqlvec "update world set \"randomNumber\" = :randomNumber where id = :id returning id" {:randomNumber 5 :id 1})
["update world set \"randomNumber\" = ? where id = ? returning id" 5 1]
Do you have an error message to look at?
from hugsql.
hmm, might have to dig into this further. I was updating Luminus framework benchmarks here, and got this error. org.postgresql.util.PSQLException: ERROR: column "randomNumber" of relation "world" does not exist
. However, doing it the other way seems to work.
from hugsql.
These queries all work for me on postgresql in my test suite:
-- :name create-world :!
create table world (
id int,
"randomNumber" int
)
-- :name drop-world :!
drop table if exists world
-- :name insert-world<! :<!
insert into world (id, "randomNumber")
values (:id, :randomNumber)
returning id
-- :name update-world<! :<!
-- update an existing world record
UPDATE world
SET "randomNumber" = :randomNumber
WHERE id = :id
RETURNING id
(testing "possible double-quote bug"
(when (= db-name :postgresql)
(= [0] (drop-world db))
(= [0] (create-world db))
(= [{:id 1}] (insert-world<! db {:id 1 :randomNumber 5}))
(= [{:id 1}] (update-world<! db {:id 1 :randomNumber 42}))))
from hugsql.
Hmm, yeah that's odd. I just tried this on my machine at home and it works fine. When I tried it on a different machine earlier I got the same error as travis. Perhaps it's something to do with the version PG itself.
from hugsql.
Oh I think I figured it out. The query returns a randomworld
key that's lower case. However, I was looking for the randomWorld
key when updating. Nothing to do with HugSQL. :)
from hugsql.
Related Issues (20)
- Optional null parameters HOT 1
- 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
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.