ansrivas / scylla-rust-driver

Async CQL driver for Rust, optimized for Scylla!

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ScyllaDB Rust Driver

This is a client-side driver for ScyllaDB written in pure Rust with a fully async API using Tokio. Although optimized for ScyllaDB, the driver is also compatible with Apache Cassandra®.

Note: this driver is still in early development and is not for production nor officially supported.

Getting Started

let uri = "127.0.0.1:9042";

let session: Session = SessionBuilder::new().known_node(uri).build().await?;

if let Some(rows) = session.query("SELECT a, b, c FROM ks.t", &[]).await? {
    for row in rows.into_typed::<(i32, i32, String)>() {
        let (a, b, c) = row?;
        println!("a, b, c: {}, {}, {}", a, b, c);
    }
}

Please see the full example program for more information. You can also run the example as follows if you have a Scylla server running:

SCYLLA_URI="127.0.0.1:9042" cargo run --example basic

Features and Roadmap

The driver supports the following:

  • Asynchronous API
  • Token-aware routing
  • Shard-aware routing (specific to ScyllaDB)
  • Prepared statements
  • Query paging
  • Compression (LZ4 and Snappy algorithms)
  • CQL binary protocol version 4
  • Batch statements
  • Configurable load balancing policies
  • Driver-side metrics

We are planning to implement the following:

  • Restarting nodes :)
  • Configurable retry policies
  • Authentication support
  • TLS support
  • CQL tracing

Getting Help

Please join the #rust-driver channel on ScyllaDB Slack to discuss any issues or questions you might have.

Reference Documentation

Other Drivers

License

This project is licensed under either of

at your option.

About

Async CQL driver for Rust, optimized for Scylla!

License:Apache License 2.0


Languages

Language:Rust 100.0%