is there a way to differentiate between reference and value structures when using keywords? using a keyword from clojure.java/jdbc
things get interpolated correctly using a protocol extension on ISQLParameter
, but from honeysql the keyword renders as a database reference. i've solved this by single-quoting the tail of the keyword, but wonder if i'm missing something since i started futzing with honeysql main to support this as i expected.
@goedelsoup Can you share some code? Not quite sure what you're referring to...
I'm having a hard time imagining the HoneySQL code you're talking about...
cleaned it as well as i could....`triage-status` here is a keyword representing an enum
(-> (sqlh/select :*
(sqlh/from [member-subquery :member_subquery])
(sqlh/where [:= :covid_registry_rank 1])
(sqlh/merge-where [:= :triage-status triage-status])
so it gets rendered as a column reference vs a value, which was the dev's intent.i dug into format
and to-sql
and this distinction seems hard to make
as is, the value ends up as the column name on the RHS
i agree with how this is constructed, so my question is moreso, how should you construct a predicate based on a keyword which is an enumeration
Ah, okay, yes... That's a tricky one since, "by definition" in HoneySQL, keywords are always treated as references to SQL entities.
If you prefix it with #sql/inline
, does that work?
(assuming you have the readers in play)
nope, i have to single quote the tail of the keyword afaik
i will double check that, but i tried a lot of things before i realized what was going on
Feel free to open an issue on the repo with repro details. This is exactly the sort of thing I want to try and fix in HoneySQL 2.0.
i don't have gripes with it and i have workarounds. it's a positional variable, so i understand the difficulty, i'll try to minimize an example in an issue.