There's a whole bunch of early access XTDB extension implementation in this release of HoneySQL. I have not yet added documentation for it all, because I suspect some may change based on feedback from y'all XT2 users. See https://github.com/seancorfield/honeysql/blob/develop/test/honey/sql/xtdb_test.cljc for examples.
I'm using https://github.com/xtdb/xtdb/blob/main/jdbc/src/main/clojure/xtdb/next/jdbc.clj and my ns keys get transformed from :project/date-modified -> project$date_modified
@avocabio That's in XTDB's SQL layer and nothing to do with HoneySQL. I am well aware of the issue -- I've been in your discussions with the XT team -- and I'm working with them on ways to integrate this better at a JDBC level.
Did you get to actually insert a column in this format \"baz/quux\" ? Even with psql it's not working: => insert into test (_id, "baz/quux") values (1, "foo"); ERROR: Errors parsing SQL statement: - line 1:23 token recognition error at: '"baz/'
Like I said, that's nothing to do with HoneySQL.
Yes ok I tough you could be using another setup but I see that the test are pure and only checking if it build the expected sql. Thanks.
If that no longer works, XTDB must have changed things in their SQL parser -- it used to work. Perhaps they're enforcing the $ mapping now? That would make my life easier 🙂
@jarohen Is that expected? foo/bar used to be a valid column name in XTDB (but was turned into foo$bar under the hood) -- now it seems that is no longer accepted?
(I'd certainly be happy to remove the experimental :xtdb dialect from HoneySQL so I don't have to deal with a mode where those qualified column names get passed through like that!)
if it's double-quoted we take it literally, no transformations, and then disallow '/'
so yeah, explicit $ is the way to go in SQL
there's very little normalisation happening in our SQL now
Cool, thanks. I just tested locally with the latest XTDB Docker and the latest next.jdbc and confirmed that neither quoted "foo/bar" nor unquoted foo/bar is acceptable at a SQL level -- makes my life simpler since I can remove the :xtdb dialect from HoneySQL (and default to :ansi) since special handling is no longer required.