This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-01-22
Channels
- # announcements (28)
- # babashka (77)
- # beginners (122)
- # calva (40)
- # circleci (3)
- # clj-kondo (47)
- # cljs-dev (9)
- # clojure (119)
- # clojure-australia (1)
- # clojure-europe (88)
- # clojure-nl (3)
- # clojure-uk (33)
- # code-reviews (64)
- # core-logic (37)
- # cursive (10)
- # datomic (13)
- # emacs (1)
- # fulcro (4)
- # graalvm (1)
- # graphql (5)
- # helix (4)
- # integrant (25)
- # jobs (1)
- # jobs-rus (1)
- # off-topic (3)
- # pathom (12)
- # random (1)
- # re-frame (48)
- # reagent (1)
- # remote-jobs (1)
- # reveal (1)
- # rewrite-clj (4)
- # ring (6)
- # ring-swagger (1)
- # shadow-cljs (21)
- # sql (8)
- # tools-deps (25)
- # vim (15)
- # xtdb (12)
With conman I get
ERROR: function lower(jsonb) does not exist Hint: No function matches the given name and argument types. You might need to add explicit type casts.
The query in question though seems (to me) to be clearly specify a text column (there are sibling jsonb columns). Is there a place I can learn about how to pass conman explicit type casts?@mksybr We'll need a lot more information to help you with that 🙂 How are you doing the query that causes that error?
It looks like conman
wraps HugSQL -- do you have your queries in separate .sql
files that are being loaded by conman
/HugSQL?
If so, you can put whatever SQL you need -- including casts -- into the .sql
file.
Ugh, conman
uses a global dynamic var for the connection 😞
Sorry for the delay. Yes I have the causitive query: Sometimes its get-user-by-username, othertimes its get-user-by-email
-- :name get-user-by-username
-- :command :query
-- :result :one
-- :doc Selects the user matching the username
SELECT
id,
status,
email,
username,
password,
user_data,
history,
permissions
FROM
users
WHERE
LOWER(username) = LOWER(:username);
-- :name get-user-by-email
-- :command :query
-- :result :one
-- :doc Selects the user matching the email
SELECT
id,
status,
email,
username,
password,
user_data,
history,
permissions
FROM
users
WHERE
LOWER(email) = LOWER(:email);
The confusing part is LOWER(jsonb) is what it complains about, but I didnt think email or username are being passed as jsonb.
Re global dynamic var, yes that actually stumped me up a bit because I found a example that explicitly passed in the db connection. I only have one database right now, which seems like it might be a benefit of being more explicit, is there other benefits to avoiding the global dynamic approach?