Cassandra (CQL) driver for Rust, using the DataStax C/C++ driver under the covers.
Branch: master
Clone or download
Pull request Compare This branch is 189 commits ahead of tupshin:master.
Latest commit 02b47e1 Jan 22, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
examples Support bind() at type List. Jan 15, 2019
src Correct drop order for completed futures. Jan 21, 2019
tests
.gitignore Move examples to examples directory. Jun 12, 2017
.travis.yml update-cassandra-cpp-sys Dec 3, 2018
CHANGELOG.md Fix date in CHANGELOG. Jan 22, 2019
CONTRIBUTING.md Bump version for release; also document in CONTRIBUTING. Aug 30, 2017
Cargo.toml Bump version to 0.14.0. Jan 22, 2019
LICENSE Fix formatting of license (no text changes). Jun 16, 2017
README.md Remove `Cargo.toml` instructions from README Dec 13, 2017
build.rs
clippy.toml merging PRs with formatting changes, adding clippy toml, etc. housecl… Dec 4, 2016
rustfmt.toml merging PRs with formatting changes, adding clippy toml, etc. housecl… Dec 4, 2016

README.md

Build Status Current Version License

cassandra-cpp

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

It is a wrapper around the raw driver binding crate cassandra-cpp-sys.

Documentation (crates.io).

Getting started

For this crate to work, you must first have installed the datastax-cpp driver. Follow the steps in the cpp driver docs to do so. Pre-built packages are available for most platforms.

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

Documentation

See the API documentation.

The Cassandra Query Language (CQL) documentation is likely to be useful.

Since this crate provides a relatively thin wrapper around the DataStax driver, you may also find the DataStax documentation and API docs useful.

Example

For a straightforward example see simple.rs.

There are additional examples included with the project in tests and examples.

Migrating from version 0.8

The API changed significantly in version 0.10. (Version 0.9 was skipped, for consistency with the cassandra-cpp-sys version number.) For a summary of the main changes, see CHANGELOG.

License

This code is open source, licensed under the Apache License Version 2.0 as described in LICENSE.

Contributing

Please see CONTRIBUTING.md for details on how to contribute to this project.

Development

This crate is regularly built by Travis; to see details of the most recent builds click on the "build" badge at the top of this page.

You must have the DataStax driver installed on your system in order to build this crate.

The unit tests assume Cassandra is running on the local host accessible on the standard port. The easiest way to achieve this is using Docker and the standard Cassandra image, with

docker pull cassandra
docker run -d --net=host --name=cassandra cassandra

You should run them single-threaded to avoid the dreaded org.apache.cassandra.exceptions.ConfigurationException: Column family ID mismatch error. The tests share a keyspace and tables, so if run in parallel they interfere with each other.

cargo test -- --test-threads 1

Remember to destroy the container when you're done:

docker stop cassandra
docker rm cassandra

History

This project was forked from cassandra, which was no longer being maintained.