Fork me on GitHub
Cora (she/her)21:07:17

I have a fun little issue

Cora (she/her)21:07:32

specifically I have a library that registers a clause before honeysql helpers are loaded

Cora (she/her)21:07:43

and so this assertion fails

Cora (she/her)21:07:53

you can open a repl using clj -Sdeps '{:deps {com.github.seancorfield/honeysql {:mvn/version "2.2.891"}}}'

Cora (she/her)21:07:07

and then use this to trigger the assertion error

(require '[honey.sql :as sql]
         '[clojure.string :as str])

 (fn [_ [table & columns]]
   [(str (sql/sql-kw :on)
         " "
         (sql/format-entity table)
         (str/join ", "
                   (mapcat sql/format-expr columns))

(require '[honey.sql.helpers :as sql.helpers])

Cora (she/her)21:07:11

I'll file an issue

Cora (she/her)21:07:14

and maybe do a PR

Cora (she/her)22:07:37

I ran into this because I have non-helper-generated clauses that I need to merge and wanted to use the helpers to do it

Cora (she/her)22:07:58

it would be super nice to have a merge that would merge each of the clause types between two maps

Cora (she/her)22:07:16

but I'll definitely work something out in my app before considering contributing it back


@corasaurus-hex It would probably be better to add a builtin-base-clause-order and use that in the assert and have base-clause-order initialized from that new sequence?


Hmm, yeah, I just happened to have that file open right now, looking at another issue. I wonder why I set up the assert on the mutable clause order instead of the base one...?


So I think I can just change that one line in the assert and we're all good @corasaurus-hex?

Cora (she/her)03:07:06

I'll bet you started with base-clause-order or current-clause-order and then needed to re-use the same starting structure with the other var, giving you default-clause-order

Cora (she/her)03:07:15

I just pushed up to that branch

Cora (she/her)03:07:19

if you'd rather just merge


Heh, I already made the one word change locally but I'll check your PR and take that instead 🙂


Updated changelog. There should be a new SNAPSHOT up on Clojars shortly that you can use, or via git deps. I have a few more problems to solve before I release 2.3.x...


Much appreciated -- that's a really interesting edge case to have detected. Thank you!


(so the builtin list never changes -- and then the assert correctly reflects the internal consistency that is needed there)

Cora (she/her)22:07:01

sure, that would work

Cora (she/her)22:07:03

i'm afk right now but i'll update when i'm home