This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-08-05
Channels
- # admin-announcements (3)
- # architecture (1)
- # beginners (16)
- # boot (14)
- # cljsrn (205)
- # clojars (4)
- # clojure (100)
- # clojure-austin (2)
- # clojure-india (1)
- # clojure-poland (7)
- # clojure-russia (95)
- # clojure-spec (25)
- # clojure-uk (127)
- # clojurescript (32)
- # core-async (7)
- # cursive (2)
- # datascript (4)
- # datomic (3)
- # editors-rus (1)
- # emacs (8)
- # events (10)
- # funcool (5)
- # gorilla (2)
- # hoplon (6)
- # jobs (1)
- # lein-figwheel (7)
- # leiningen (2)
- # luminus (11)
- # om (7)
- # onyx (119)
- # other-languages (31)
- # proto-repl (1)
- # proton (37)
- # protorepl (3)
- # re-frame (60)
- # reagent (8)
- # spacemacs (9)
- # specter (21)
- # spirituality-ethics (2)
- # yada (10)
do i need to do something special to use hugsql snippets with conman? Parameters are never passed to the snippet. Debugging found that db connection is passed instead the parameters map.
this is the state on sqlvec-fn*
when calling a snippet (search-snip {:tenant-id 1698})
:
Class: clojure.lang.PersistentArrayMap
Contents:
0. [ psql [ "FROM trd_product p, trd_contract c\nWHERE p.productid = c.productid AND\n p.tenantid = " { :type :v, :name :tenant-id } ] ]
1. [ options {} ]
2. [ y hugsql.core$sqlvec_fn_STAR_$y__64066@2084d943 ]
3. [ param-data { :datasource HikariDataSource (HikariPool-21) } ]
4. [ opts { :tenant-id 1698 } ]
@jmayaalv That definitely looks like a bug, because sqlvec functions should not take a db connection at all.
Ah, maybe it is the usage of sqlvec function vs a :snip
. Conman should handle snippets just fine. How is search-snip defined in your SQL file?
this is the snippet:
-- :snip search-snip
FROM trd_product p, trd_contract c
WHERE p.productid = c.productid AND
p.tenantid = :tenant-id
It might be worth putting this in as a bug so we can get to the bottom of it. HugSQL passes metadata along indicating that the function is a snippet, and conman uses that to handle snippets differently. Feel free to put in an issue on HugSQL, and we'll try to reproduce the issue: https://github.com/layerware/hugsql/issues
thanks @curtis.summers. i will
You're welcome! π