4 ms·
Hey, I'm one of the maintainers for clj-rethinkdb. There's a few things I can discuss here. > You need to rely on a "query-builder" One of the beautiful thing
by dantiberian 11y ago
Hey, I'm one of the maintainers for clj-rethinkdb. There's a few things I can discuss here.
> You need to rely on a "query-builder"
One of the beautiful things about RethinkDB is it's query language. It is basically S-expressions but in vectors instead of lists. This pairs really well with Clojure as Clojure is made up of S-expressions too. All of the drivers do use some kind of a query builder internally (as far as I'm aware) to build up the query data structure, then they call run on it. This process is just a bit more explicit in clj-rethinkdb, and has all kinds of benefits, like being able to make partial functions, and compose ReQL functions really nicely.
> The documentation is also quite incomplete
clj-rethinkdb follows the official JavaScript API quite closely. There were two options: create minimal docstrings in Clojure and leave the main documentation up to RethinkDB, or copy all of the documentation into clj-rethinkdb. There are a few issues with the second approach, the most obvious is how to efficiently copy it, but also that different versions of the RethinkDB server support different functions and options, so we'd need to keep compatibility notes, e.t.c. A really nice approach is in https://github.com/rethinkdb/docs/issues/710 https://github.com/rethinkdb/docs/issues/710, and https://github.com/rethinkdb/docs/issues/803 https://github.com/rethinkdb/docs/issues/803 but that requires more work.
All of that to say, at the moment the best option is to read the JavaScript docs first, then look at the Clojure docstrings for argument order or special notes.
> now that the official java client is out, should I use this from my Clojure app or keep using the other one?
It makes a lot of sense for clj-rethinkdb to take use of as much of the Java driver as possible. I haven't got any news yet, but it's likely we'll be at least poaching the connection and request/response handling.
I'd be happy to jump on a Hangout or text chat in https://gitter.im/apa512/clj-rethinkdb https://gitter.im/apa512/clj-rethinkdb to help you get over any speed bumps using the clj-rethinkdb driver. Hearing a first time users experience would be really good.