reql 0.0.6-alpha4

A native RethinkDB driver
Documentation

RethinkDB Driver

This is a RethinkDB driver written in Rust.

Build Status Latest Version Docs

Note: While this driver is already usable in the current state, the API is not yet stable and many commands are not yet implemented. I recommend you pin to specific versions if you have to code against it. Also kindly submit an issue or pull request if the command you want is missing.

Getting Started

Add this crate to your dependencies section:-

[dependencies]
reql = "0.0.5"

Import it in your main.rs or lib.rs:-

extern crate reql;

Create a connection pool and connect to your database server(s) in your main or similar function if creating a library:-

extern crate reql;

use reql::r;

fn main() {
    r.connection().connect().expect("Failed to connect to the database server");
}

Run ReQL commands:-

extern crate reql;
extern crate futures;

use reql::{r, Command};
use futures::stream::Stream;

fn print_users() -> Result<(), Error> {
    let users = try!(r.table("users").run::<User>());
    let response = users.for_each(|user| {
        println!("{:?}", user);
        Ok(())
    });
    for v in response.wait() {
        // Do something with v
    }
}

fn main() {
    r.connection().connect().expect("Failed to connect to the database server");
}