Crates.io | scylla |
lib.rs | scylla |
version | 0.14.0 |
source | src |
created_at | 2021-04-07 14:35:33.712686 |
updated_at | 2024-09-05 11:52:22.595576 |
description | Async CQL driver for Rust, optimized for Scylla, fully compatible with Apache Cassandraâ„¢ |
homepage | |
repository | https://github.com/scylladb/scylla-rust-driver |
max_upload_size | |
id | 380375 |
size | 1,361,240 |
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 officially supported but currently available in beta. Bug reports and pull requests are welcome!
The documentation book is a good place to get started. Another useful resource is the Rust and Scylla lesson on Scylla University.
use futures::TryStreamExt;
let uri = "127.0.0.1:9042";
let session: Session = SessionBuilder::new().known_node(uri).build().await?;
let raw_iter = session.query_iter("SELECT a, b, c FROM ks.t", &[]).await?;
let mut iter = raw_iter.into_typed::<(i32, i32, String)>();
while let Some((a, b, c)) = iter.try_next().await? {
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
All examples are available in the examples directory
The driver supports the following:
Ongoing efforts:
Please join the #rust-driver
channel on ScyllaDB Slack to discuss any issues or questions you might have.
Our driver's minimum supported Rust version (MSRV) is 1.66.0. Any changes will be explicitly published and will only happen during major releases.
This project is licensed under either of
at your option.