Comments (8)
That is strange. contains?
should only be accessing the params hashmap, not the actual value for the key it's looking for.
Where does your execute!
function come from? What does it look like? Is it possibly unpacking the sql-args
?
from hugsql.
First, I define queries
which contains a map with all database functions:
(def queries
(hugsql/map-of-db-fns "sql/events.sql"))
Then, I use the executeQuery
function as a wrapper of this piece of code ((-> queries query :fn) db args)
:
;; executeQuery comes from another namespace
(s/defn executeQuery
[queries :- {s/Keyword s/Any}
db :- ConnectionMap
query :- s/Keyword
args :- {s/Keyword s/Any}]
((-> queries query :fn) db args))
And execute!
is just executeQuery
curried (with the queries):
(def execute! (partial executeQuery queries))
I will go back to test on version 0.4 because I am pretty sure it was working before. Give me a couple of minutes.
from hugsql.
Nevermind, I forgot that map-of-db-fns was added on version 0.4.1.
from hugsql.
Curtis, I am not having this issue with version 0.4.1.
from hugsql.
I'm having trouble duplicating your issue:
user=> (require '[hugsql.core :as hugsql])
nil
user=> (hugsql/sqlvec "insert into test (:i*:fields) values (:v*:values)" {:fields ["id","uuid","name"] :values [1 (java.util.UUID/randomUUID) "Bo"]})
["insert into test ( id, uuid, name ) values ( ?,?,? )" 1 #uuid "dd09cde2-8966-413d-b756-c1dd328e2002" "Bo"]
from hugsql.
Ok. Let me double check that if change to version 0.4.2 without touching anything it will break again.
from hugsql.
Curtis, now I am a bit confused. For some reason, moving back to version 0.4.1 and then up to 0.4.2 solved the problem. In between I executed lein clean
, could be related to that?
Anyway, thanks for you time!
from hugsql.
Maybe? I've had to do a few lein clean
in my time to fix strange behavior. Glad you worked it out. I'm glad to see you and others using HugSQL in depth. I like how you're using map-of-db-fns
and Schema together.
from hugsql.
Related Issues (20)
- Taking array as an input
- Not able to update multiple column values
- 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
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.