1. 11
    1. 1

      I’m interested bitemporal databases and Datalog as a query language, so it’s always cool to see progress on Crux! Unfortunately, the Clojure bits have always made Datomic and Crux a bit impenetrable to me. I wrote some Clojure with friends in college, but didn’t enjoy or understand it to the extent needed to be the “Clojure Prophet” at my workplace. There’s always a Java API, but these tend to be very verbose, and the HTTP API only accepts EDN (the JSON of Clojure syntax) for queries.

      That’s what makes the new new Kotlin query DSL is interesting, here’s a sampler from one of its tests:

      // not shown: predefinition of person*, age* and *Key
      // symbol constants
      db.q {
                      find {
                          +person1
                      }
      
                      where {
                          person1 has ageKey eq age1
                          person2 has ageKey eq age2
                          person2 has nameKey eq "Ivana"
                          age1 eq age2
                      }
                  }.singleResultSet(),
      

      Still, compared to the EDN form, this is quite verbose. I wish there was a way to write actual Datalog queries against Crux, but it’s probably easier to internalize the EDN than try to make this kind of wrapper.

      1. 2

        We do have Kotlin users who skip the wrapper and query with EDN Datalog, so I can attest that it’s an option. :)

        The topic of supporting “actual” Datalog has come up quite a few times — in the early days, I was a big proponent. Unfortunately, there is no such thing as standard Datalog. As such, any Datalog grammar the Crux team comes up with will be just as fabricated as EDN Datalog. Because of this, the team has decided to stick with EDN Datalog as the primary query language for Crux 1.x. Crux 2.x will support both EDN Datalog and a complete SQL surface area.