Popularity
2.3
Growing
Activity
0.0
Stable
50
4
16

Programming language: Rust
License: Apache License 2.0
Tags: Cassandra    
Latest version: v0.8.1

cassandra-rust alternatives and similar packages

Based on the "Cassandra" category.
Alternatively, view cassandra-rust alternatives based on common mentions on social networks and blogs.

  • cdrs

    Cassandra DB native client written in Rust language. Find 1.x versions on https://github.com/AlexPikalov/cdrs/tree/v.1.x Looking for an async version? - Check WIP https://github.com/AlexPikalov/cdrs-async
  • cassandra-rs

    Cassandra (CQL) driver for Rust, using the DataStax C/C++ driver under the covers.

Do you think we are missing an alternative of cassandra-rust or a related project?

Add another 'Cassandra' Package

README

Build Status Current Version License: MPL-2.0

cassandra-rs

This is a maintained rust project that exposes the cpp driver at https://github.com/datastax/cpp-driver/ in a somewhat-sane crate.

For the wrapper to work, you must first have installed the datastax-cpp driver.

Follow the steps on the cpp driver docs to do so.

Make sure that the driver (specifically libcassandra_static.a and libcassandra.so) are in your /usr/local/lib64/ directory

You can use it from cargo with

    [dependencies.cassandra]
    git = "https://github.com/tupshin/cassandra-rs"

Or just

    [dependencies]
    cassandra="*"

Here's a straightforward example found in simple.rs:

    #[macro_use(stmt)]
    extern crate cassandra;
    use cassandra::*;
    use std::str::FromStr;


    fn main() {
        let query = stmt!("SELECT keyspace_name FROM system_schema.keyspaces;");
        let col_name = "keyspace_name";

        let contact_points = ContactPoints::from_str("127.0.0.1").unwrap();

        let mut cluster = Cluster::default();
        cluster.set_contact_points(contact_points).unwrap();
        cluster.set_load_balance_round_robin();

        match cluster.connect() {
            Ok(ref mut session) => {
                let result = session.execute(&query).wait().unwrap();
                println!("{}", result);
                for row in result.iter() {
                    let col: String = row.get_col_by_name(col_name).unwrap();
                    println!("ks name = {}", col);
                }
            }
            err => println!("{:?}", err),
        }
    }

There's additional examples included with the project in src/examples.


*Note that all licence references and agreements mentioned in the cassandra-rust README section above are relevant to that project's source code only.