Closed phenomax closed 6 years ago
Hey!
I'm sorry. Documentation is one of the things that this driver still seriously lacks.
In building this driver, I made an assumption that you would most likely be running a cluster of more than one server in production. So instead of host
, connect()
accepts an array of servers
. Please see https://github.com/rethinkdb-rs/reql/blob/7ff6d3113c548776f73d47f3f0b3de702f60a990/examples/map.rs#L31 for an example that does this. You don't have to enumerate all the servers in your cluster though, just enough to make sure that at least one of those servers will be up when you try to connect for the first time. The rest will be discovered automatically. Also use user
instead of username
.
So
let conn = r.connect(args!(core.handle(), {host: "host", username: "username", password: "password"})).unwrap();
should be
let conn = r.connect(args!(core.handle(), {servers: ["host"], user: "username", password: "password"})).unwrap();
Thanks for taking time! I don't think that you are lacking documentation. It is just some kind of weird to see Javascript examples for connection establishment. I think it would be a good idea to show a rust example there using the args macro, too.
Thanks for taking time!
No problem :) Did that solve your issue?
It is just some kind of weird to see Javascript examples for connection establishment.
I know. The commands are auto generated from the official Javascript documentation. Eventually, I would like to try and make the build script automatically convert those Javascript examples to Rust too but I don't have time to work on that right now.
Yeah, I can connect now. Thanks again :D
My pleasure.
Hey! I followed the example code and opened a connection to my RethinkDB with my credentials like this:
But when I want to run my program, it panics with the following error
The connection to my database and my credentials work. I am on Windows 10 with rustc 1.21.0 and
What did I do wrong? Thanks in advance.