I'm starting work on XTDB compatibility in HoneySQL -- https://github.com/seancorfield/honeysql/issues/532 -- and, while some things are obvious to me, several things are not so I'd like to ask any of you who are a) using XT2 b) using the SQL approach c) using HoneySQL to generate SQL + params, what are the sharp edges you're running into with this?
See https://github.com/seancorfield/honeysql/blob/develop/test/honey/sql/xtdb_test.cljc for a few tests I've written so far (`EXCLUDE` and RENAME are newly supported today).
I've made my own challenge based on https://docs.xtdb.com/static/learn-xtql-today-with-clojure.html: How to find a person that is not a director and not an actor. I'm playing around a bit but the only thing I can come up with is to manually materialize both tables and then do a clojure.set/difference on the ids. Help please. 🙂
Using SQL I could LEFT JOIN with a NULL CHECK to find that person.
Cool 🙂 there isn't a left-join example in that tutorial (yet!) but there is a left-join operator: https://docs.xtdb.com/reference/main/xtql/queries.html#_joins
It's cool to just be able to drop to SQL solve the problem, I was just hoping for a "DWIM not", like so:
(q '(-> (unify (from :persons [xt/id person/name])
(where (not (exists? (from :movies [{:movie/director xt/id}])))))
(return person/name)))There might well be a way 🤔 I don't have spare brain cycles to boot it up right now though
It's all good. I'm grateful for the support thus far and don't expect 24/7 live support. 🙂