Async Rust driver for the Scylla database written in Rust. Although optimized for Scylla, the driver is also compatible with Apache Cassandra®.
Documentation book
The best source to learn about this driver is the documentation book.
This page contains mainly API documentation
Other documentation
Driver overview
Connecting
All driver activity revolves around the Session
Session
is created by specifying a few known nodes and connecting to them:
use ;
use Error;
async
Session
is usually created using the SessionBuilder.
All configuration options for a Session
can be specified while building.
Making queries
After successfully connecting to the cluster we can make queries.
The driver supports multiple query types:
- Simple
- Simple paged
- Prepare (need to be prepared before use)
- Prepared paged
- Batch
To specify options for a single query create the query object and configure it:
- For simple: Query
- For prepared: PreparedStatement
- For batch: Batch
The easiest way to specify bound values in a query is using a tuple:
# use Session;
# use Error;
# async
But the driver will accept anything implementing the trait ValueList
Receiving results
The easiest way to read rows returned by a query is to cast each row to a tuple of values:
# use Session;
# use Error;
# async
See the book for more receiving methods