Fork me on GitHub
jimi hendrix14:01:22

Is there any support for postgres's CTE?


fwiw, I have extended honeysql to support BigQuery CTEs (which are similar to Postgres CTEs). It was pretty easy


(defmethod fmt/format-clause ::with [[_ ctes] _]
  (str "WITH " (fmt/comma-join (map (fn [[cte alias]]
                                      (try (str (fmt/to-sql alias) " AS " (fmt/to-sql cte))
                                           (catch Exception e
                                             (throw (ex-info "Unable to format"
                                                             {:alias alias :cte cte}


FYI with will be built-in with v2.


Yes, via “with”


Iirc the merge helper is missing


AFK right now so can’t help with sample code


And then I usually take a look at when I need to remind myself of some of the options. I also build the HSQL manually and without helpers…a habit I would like to break because I imagine that they are actually “helpful”

Janne Sauvala17:01:24

HoneySql 2 looks promising. What is the state of it? Is it too early to start using it?


@janne.sauvala agreed. I’m not speaking for Sean, but TMK it’s still in an “evolving” state.


@janne.sauvala v2 is very much in "hammock mode" right now. The v2 branch mostly works but there are some features from v1 not implemented yet -- still figuring out the best approach. Several features will behave differently but v2 uses different namespaces (and will have a different Maven coordinate: seancorfield/honeysql) so you can load both v1 and v2 into your project and migrate piecemeal.

Janne Sauvala10:01:29

Good to know I can use them at the same time - I might go that route if I feel that v2 seems to be more superior 🙂


I'm hoping to have something "usable" next week. I'm taking four days off to work on OSS (Thu-Tue) and I plan to deal with the parameterization issue which is the current blocker as far as I'm concerned. If I can get that working this weekend and get all the tests to pass, then I'll probably ask folks to test it -- if I can also get enough documentation in place.


I don't consider it even "alpha" yet and I'm not yet trying to use it at work 🙂

Janne Sauvala10:01:32

I think Clojure has spoiled me with the definition of “alpha” in our community. Usually alpha versions of any Clojure lib works fine but in any other language those alpha versions barely even compiles 😄


I'm taking a few days off at the end of this week (Thursday through Tuesday) and plan to spend quite a bit of time on OSS projects -- which is possible because of GitHub sponsorship! I'll probably tackle stuff in the order: next.jdbc, depstar, clj-new, and then HoneySQL v2 (but those first three projects only need a few hours of time on them).

🎉 14

FYI with will be built-in with v2.