sql

Samuel Ludwig 2025-05-13T14:34:46.480819Z

@seancorfield The sql/find-by-keys and similar convenience functions have been great and covered 90% of use-cases in my (#polylith ) repo; the one case where I've needed to reach for something else was when joining two tables- I was looking at the source of for-query (and associated fns), and feel like I could see a place where a join could be substituted in The form-factor I have in mind would be that the table argument could also be a vector of table-names, or pairs of table-names and aliases (not a map because ordering), and the opts map could take a :join-type (one of :left, :right, :inner, :outer, etc.) and a :join-on option (vector of one or more pairs of columns to test for equality) the :join-type is maybe short-sighted in that it forces the same join type on all tables do you think this would be a violation of find-by-keys etc. simplicity, or would otherwise compromise next.jdbc's design?

Samuel Ludwig 2025-05-13T14:36:16.198959Z

I do note your comment here on the .sql namespace https://github.com/seancorfield/next-jdbc/issues/56#issuecomment-522361392, so perhaps this would fall into that DSL category

seancorfield 2025-05-13T14:36:25.625009Z

As the docs say: for more complex queries, use HoneySQL.

Samuel Ludwig 2025-05-13T14:36:41.321999Z

fair fair sir

seancorfield 2025-05-13T14:36:59.474369Z

JOIN in particular is complex -- see all the various join options in HoneySQL 🙂

😅 1