xtdb

seancorfield 2024-11-23T21:36:00.491739Z

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.

❤️ 2
Panel 2024-11-24T00:45:44.978299Z

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

🙌 1
seancorfield 2024-11-24T00:57:21.572749Z

@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.

🙌 1
Panel 2024-11-24T01:03:34.331189Z

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/'

seancorfield 2024-11-24T01:27:46.509669Z

Like I said, that's nothing to do with HoneySQL.

Panel 2024-11-24T01:34:54.774429Z

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.

seancorfield 2024-11-24T01:41:44.652449Z

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 🙂

seancorfield 2024-11-24T01:52:43.828429Z

@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?

seancorfield 2024-11-24T01:54:45.991069Z

(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!)

jarohen 2024-11-24T02:03:09.833199Z

if it's double-quoted we take it literally, no transformations, and then disallow '/'

jarohen 2024-11-24T02:03:29.792849Z

so yeah, explicit $ is the way to go in SQL

jarohen 2024-11-24T02:03:42.566539Z

there's very little normalisation happening in our SQL now

seancorfield 2024-11-24T02:20:48.057119Z

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.

👌 1
🙏 1