This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-03-15
Channels
- # announcements (10)
- # asami (5)
- # babashka (49)
- # babashka-sci-dev (8)
- # beginners (25)
- # calva (98)
- # cider (2)
- # clj-kondo (22)
- # clojure (32)
- # clojure-dev (12)
- # clojure-europe (32)
- # clojure-nl (3)
- # clojure-spec (3)
- # clojure-uk (10)
- # clojurescript (12)
- # community-development (1)
- # conjure (71)
- # cursive (7)
- # datalog (6)
- # events (2)
- # figwheel-main (2)
- # fulcro (4)
- # jobs (2)
- # kaocha (3)
- # lsp (43)
- # membrane (12)
- # missionary (9)
- # off-topic (61)
- # pathom (7)
- # polylith (2)
- # reagent (38)
- # remote-jobs (4)
- # shadow-cljs (17)
- # specter (1)
- # tools-deps (38)
- # vim (51)
- # web-security (5)
Has anyone ever attempted to make an abstraction layer over the various clojure datalog dbs? I know it'd be pretty leaky
I've kind of done this by accident in a Polylith app. since all the updates and queries are happening behind the
surface, I could change it not just between Datomic and Datahike, but all the way to SQL, without anyone else caring.
in terms of querying, though, Datomic is a de-facto standard and most queries will work identically (up to ordering of results) in Datahike, Datalevin, and DataScript.
(Crux is another matter)
Yeah I was just trying something with both datascript and datalevin and it got me curious if someone took that kind of thing to the extreme.
A lot of ~portable edn Datalog should "just work" with XT (Crux), with the most notable caveats being:
1. variable attributes - XT's query planner has to know all attributes in advance, but as a workaround you can usually just generate lots of queries instead
2. multiple db sources - XT query execution assumes a single index
3. transaction entities and 5-tuple clauses - not supported
4. pull
- XT implements the EQL spec instead
5. rules are defined slightly differently, since they have to be known during query compilation
There are also quite a few DataScript tests in the XT repo that can give a feel for what else works and what doesn't https://github.com/xtdb/xtdb/blob/1693a633910b9a7815ad514da2e0685b4c21cc4f/test/test/xtdb/query_test.clj#L2123-L2870