xtdb

seancorfield 2024-11-13T00:07:44.032809Z

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

🙏 1
🙌 5
benny 2024-11-13T20:36:42.993359Z

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

benny 2024-11-13T20:50:03.828739Z

Using SQL I could LEFT JOIN with a NULL CHECK to find that person.

refset 2024-11-13T21:35:50.743119Z

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

benny 2024-11-13T22:11:12.027649Z

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

👍 1
refset 2024-11-13T22:31:19.386419Z

There might well be a way 🤔 I don't have spare brain cycles to boot it up right now though

benny 2024-11-14T07:08:44.215179Z

It's all good. I'm grateful for the support thus far and don't expect 24/7 live support. 🙂

😅 1