apa512 / clj-rethinkdb

Eclipse Public License 1.0
204 stars 42 forks source link

add a `grant` method #177

Closed nha closed 8 years ago

nha commented 8 years ago

The grant method is missing (Java driver doc: https://www.rethinkdb.com/api/java/grant/ ).

It should be currently possible to work around this either by:

danielcompton commented 8 years ago

We don't currently use the Java driver, but we can provide this by adding a new term. Happy to take a PR for this. If you take a look at the rethinkdb.query namespace you can see how the terms are defined, happy to help if you have any questions. Otherwise I'll take a look at this when I have time.

nha commented 8 years ago

I started working on this at https://github.com/nha/clj-rethinkdb

I have a test failure though: Exception in thread "async-dispatch-24" java.lang.IllegalArgumentException: No enum constant rethinkdb.Ql2.Term.TermType.GRANT

Does that mean I have to use/edit https://github.com/apa512/rethinkdb-protobuf ? If yes could you clarify the relation between these two projects ?

nha commented 8 years ago

It seems the purpose of this repository is to have this file available for Clojure:

https://github.com/rethinkdb/rethinkdb/blob/next/src/rdb_protocol/ql2.proto

Here is what I tried so far :

Running 'make'
 cd . && /bin/sh /Users/nha/.lein/cache/lein-protobuf/protobuf-2.6.1/missing automake-1.14 --foreign
 >  /Users/nha/.lein/cache/lein-protobuf/protobuf-2.6.1/src/protoc ql2.proto --java_out=/Users/nha/repo/vendor/rethinkdb-protobuf/target/protosrc -I. -I/Users/nha/repo/vendor/rethinkdb-protobuf/target/proto -I/Users/nha/repo/vendor/rethinkdb-protobuf/resources/proto
java.io.IOException: Cannot run program "/Users/nha/.lein/cache/lein-protobuf/protobuf-2.6.1/src/protoc" (in directory "resources/proto"): error=2, No such file or directory
 at java.lang.ProcessBuilder.start (ProcessBuilder.java:1048)

Happy to submit a PR to https://github.com/apa512/rethinkdb-protobuf if needed after I get to test it locally (whole file or only GRANT) ?

danielcompton commented 8 years ago

I've deployed new protobuf definitions up to 2.3.0. I had trouble redeploying on my new computer, I needed to install automake-1.14 for it to build. See http://stackoverflow.com/questions/29591295/clojure-protobuf-cannot-run-program-path-protoc-in-directory-resources-pro for more details.

nha commented 8 years ago

Thanks that was indeed the problem. I also had to remove lein-protobuf from my plugin list. Would you be interested in a small addition to the README/Wiki to describe how to get started on contributing ?

I think that, apart from formatting issues I have a PR ready at https://github.com/nha/clj-rethinkdb

danielcompton commented 8 years ago

Will add a note on contributing.

Feel free to open a PR against this repo when you're ready. Also, I just had a quick look and saw a bunch of whitespace changes. It's much easier for me to review and accept a change if there aren't extra whitespace changes. Thanks!

nha commented 8 years ago

Closing since the patch has been merged. Thanks!