Major milestone: HoneySQL v2 repo now passes all the tests (for the first time!). The next two days will be about documentation!
I plan to incorporate a bunch of new tests from a recent v1 PR into the v2 test base as well.
I hope to cut a v2 alpha by the end of Tuesday.
(I also need to substantially clean up the code 🙂 but that will be an ongoing process now that I have a passing test suite)
Hey @seancorfield, just ran into surprising behavior with the way honeysql formats :values
clauses. We were inserting a collection of maps that didn't all have the same keys and discovered after a period of confusion that honeysql picks the columns based off the first map in the :values
vector. Would you be amenable to changing this so that honeysql picks the columns to be the union of all keys present in :values
maps? Happy to provide a PR.
@codonnell I'll fix that for v2 but not for v1 at this point. It's the same behavior as clojure.pprint/print-table
BTW.
(I don't think it's a bug but I agree it could be a bit surprising -- feel free to open an issue on GH so I don't forget)
Will do, thanks.
Thanks! I'll probably work on that for v2 later today.
Just a shout out for a big thanks for @seancorfield for doing the work for honeysql v2. Looking forward to it! 🙂
@codonnell That is fixed on the v2 branch.
Thanks a bunch!
@codonnell BTW, the 1.x readme says "the first map defines the columns to insert, and the remaining maps must have the same set of keys and values" (but this restriction is gone in 2.x).
Today I have mostly worked on docstrings for the public API and updating the README to ensure it's all up-to-date and has examples of several new pieces of syntax, as well as ensuring all the tests pass on Clojure 1.9/1.10/1.11 (master) and ClojureScript and that the README example code also all passes (as tests). Code-wise, I'm pretty much at a 2.0.0 Alpha 1 state now for anyone who feels adventurous enough to try it out 🙂
seancorfield/honeysql {:git/url "<https://github.com/seancorfield/honeysql>" :sha "4cbeb170ddf4ba0d7238c43b092ffb0a33062474"}
updated to latest SHA
And follow the README here https://github.com/seancorfield/honeysql/tree/v2 (not the develop branch)
I'm about to start fleshing out the "differences between v1 and v2" document and then I'll move on to full-blown documentation of v2 later today and most of tomorrow and at some point when I think there's at least enough documentation to support more widespread testing, I'll cut a 2.0.0-alpha1 release on Clojars for folks to use with Leiningen.
There's still a lot of work to do but at this point I believe v2 has reached general feature parity with v1 -- although I have deliberately not implemented several of the v1 formatting options (so I'm looking forward to some discussions about what folks rely on from v1 that I would prefer not to implement in v2 🙂 ).
Sorry, I totally missed that! Maybe it's just me, but I don't often consult the Readme anymore except to glance at an example when I don't remember syntax. I'm sure I read the prose some time ago, but didn't remember that detail. Definitely appreciate that is documented.