bitemyapp / revise

RethinkDB client for Clojure
146 stars 8 forks source link

How to run query on another database other than the default "test"? #5

Closed john2x closed 10 years ago

john2x commented 10 years ago

Hi, sorry about posting an issue about a question, but I couldn't get a hold of you on #clojure.

In the README, it seems all operations are being done on the default database "test". How do I specify a different db?

I tried

(-> (q/db "my_db")
    (q/table "users")
    (q/get id))

but it seems it's still running against "test".

Thanks.

cesarbp commented 10 years ago

There are *-db functions which take the db as a first argument. Replace table for table-db

john2x commented 10 years ago

Ah thanks. Why the specific functions for the default db?

cesarbp commented 10 years ago

Some rethinkdb functions have optional arguments on different parts i saw no better way to implement that than making multiple functions.