had to look up how to do something in honeysql and this https://github.com/seancorfield/honeysql/blob/develop/doc/clause-reference.md is so nice. Thank you!
Thank you. It's the result of a lot of community feedback! I find this easier to work with BTW https://cljdoc.org/d/com.github.seancorfield/honeysql/2.6.1243/doc/getting-started/sql-clause-reference since it also has the API reference etc.
yeah that’s nice. I misread them a bit too. you use symbols with i thought were the sql helpers which i almost never use. But they are just quoted symbols example
user=> (sql/format '{with ((stuff {select (:*) from (foo)}),
(nonsense {select (:*) from (bar)}))
select (foo.id,bar.name)
from (stuff, nonsense)
where (= status 0)})
["WITH stuff AS (SELECT * FROM foo), nonsense AS (SELECT * FROM bar) SELECT foo.id, bar.name FROM stuff, nonsense WHERE status = ?" 0]
this one i missed the quote and glossed over it because i thought it was based on all of these mentioned at the top
(refer-clojure :exclude '[partition-by])
(require '[honey.sql :as sql]
'[honey.sql.helpers :as h :refer [select from join-by left-join join
where order-by over partition-by window]])Initially, it was all keywords and values but feedback from the community was that examples with the quoted-symbolic form should also be included, so the docs are now a deliberate mix of both... I didn't want to duplicate every example to show both styles. Always open to suggestions on how to clarify things.
yeah. it’s good to have both. i thought at first they were almost all the helper version. I see it now. We use keywords which visually stand out as clearly not the helper versions. easy to miss with the symbol version, especially when the quote it further up at the top of the map
You can mix'n'match styles, and also mix'n'match with helpers too. I often write core query fragments in quoted-symbolic forms then use helpers to conditionally add more pieces.