bitemyapp / revise

RethinkDB client for Clojure
146 stars 8 forks source link

Add support for different types of queries #8

Closed cesarbp closed 10 years ago

cesarbp commented 10 years ago

Currently the only supported query type is START. Add support for the others

cesarbp commented 10 years ago

@danielytics Since you know your way around the other drivers. Can I ask you what's the behaviour of the equivalent of (Rethinkdb 1.12):

(run (r/table-create :foo) conn)
(run (r/table-create :bar) conn)
(run (r/insert (r/table :foo) {:x 1}) conn)
(run (r/insert (r/table :bar) {:y 1}) conn)
(run (r/union (r/table :foo) (r/table :bar)) conn)

Specifically, Rethinkdb returns a "partial success". Which means the same token has to be queried with a CONTINUE to get the rest of the result. I wanna know if the other drivers do that by default and deliver the whole result in one go or if they let the user fetch the rest of the response as they see fit.

@bitemyapp Any ideas are welcome for how to best implement these CONTINUE queries given the current agent/promise implementation.

cesarbp commented 10 years ago

Actually nevermind. I'll just deliver a lazy sequence.

danielytics commented 10 years ago

I've used the javascript version in the web interface a good bit to learn RethinkDB, but over all, I've done more in revise now. I'll probably need to do a little using the Python driver in the coming days, so I can report back on that.

From what I can see, it doesn't seem to make me do anything special to get the results, though when there are more than 40 (IIRC) results, the web interface paginates them (possibly using this method? I don't know). I certainly didn't notice it doing any of this.

Having said that, I agree that lazy sequences seem to be the most Clojure-like and seem like a natural fit to me.

cesarbp commented 10 years ago

Fixed in c6aca7b6179d39ac71e1fda6d1d0cbb7d530f707