This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-05-29
Channels
- # announcements (6)
- # babashka-sci-dev (15)
- # beginners (46)
- # calva (1)
- # clj-kondo (1)
- # clojure-australia (2)
- # clojure-europe (10)
- # clojure-uk (4)
- # clojured (3)
- # clojurescript (16)
- # fulcro (6)
- # helix (1)
- # hyperfiddle (8)
- # instaparse (28)
- # joyride (33)
- # malli (17)
- # off-topic (13)
- # pedestal (3)
- # portal (5)
- # react (1)
- # sci (1)
- # sql (6)
- # vim (1)
what is the typical way to pass an array (for IN :foos
) as query parameters? I am making requests to redshift-data api (not using the jdbc driver)
{:Sql "select *
from public.currency
where stat = 'crypton.transfer.roll_entries'
and ingest_ts > date '2022-05-29'
and s_data.\"unix_day\" IN :days
and version like '66.%'
limit 10"
:Parameters
[{:name "days"
:value (str "( " (str/join ", " [19140 19139]) " )")}]}
"ERROR: syntax error at or near \"$1\"\n Position: 139"What database libraries are you using? I'd use HoneySQL to build the whole [SQL & params]
vector -- it understands [:where [:in :days data]]
(although you can't use a named parameter here -- you have to let HoneySQL generate the ?
placeholders).