This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-11-11
Channels
- # announcements (1)
- # aws (5)
- # beginners (8)
- # biff (7)
- # calva (32)
- # cider (26)
- # clj-kondo (6)
- # clojure (100)
- # clojure-europe (6)
- # clojure-greece (1)
- # clojurescript (15)
- # core-logic (3)
- # fulcro (2)
- # honeysql (4)
- # hoplon (39)
- # hyperfiddle (11)
- # lsp (12)
- # other-languages (2)
- # podcasts-discuss (1)
- # squint (30)
👋 👋 Could anyone please help me understand why this is an illegal syntax?
(honey.sql/format {:select [[:+ 1 1]]})
;; => illegal syntax in select expression
I’m expecting it to generate select 1 + 1;
A scalar in :select
means value/identifier.
A 1-level vector means multiple values/identifiers.
A 2-level vector means the same, but with aliases.
A 3-level vector means the same, but with function calls.
So you need a 3-level vector. And by "3-level" I mean "nested 3 levels deep", so [[[:+ 1 1]]]
should work.
👀 1
🙏 1
@U023C0QKU4W Take a look at the SQL Expressions section early in Getting Started https://cljdoc.org/d/com.github.seancorfield/honeysql/2.5.1091/doc/getting-started -- it has examples of :select
with those 3 levels of vectors.
That makes sense! thanks!