#cassandra #cql #binding

sys cassandra-cpp-sys

A bindgen-generated Rust wrapper around the DataStax Cassandra C++ driver plus working examples. You probably want to use the "cassandra-cpp" crate which provides a safe wrapper.

9 releases (2 stable)

Uses old Rust 2015

1.1.0 Mar 30, 2022
0.12.3 Apr 30, 2021
0.12.2 Oct 6, 2020
0.12.1 Jan 29, 2020
0.8.8 Jun 29, 2017

#1122 in Database interfaces

Download history 158/week @ 2023-11-19 223/week @ 2023-11-26 258/week @ 2023-12-03 42/week @ 2023-12-10 250/week @ 2023-12-17 24/week @ 2023-12-24 35/week @ 2023-12-31 414/week @ 2024-01-07 224/week @ 2024-01-14 189/week @ 2024-01-21 302/week @ 2024-01-28 379/week @ 2024-02-04 219/week @ 2024-02-11 372/week @ 2024-02-18 3066/week @ 2024-02-25 213/week @ 2024-03-03

3,881 downloads per month
Used in 3 crates

Apache-2.0

415KB
11K SLoC

Build Status Current Version License

cassandra-cpp-sys

This is a maintained Rust project that provides a low-level binding of the DataStax cpp driver at https://github.com/datastax/cpp-driver/ . It is mostly autogenerated. It was originally a fork of https://github.com/tupshin/cassandra-sys-rs/ but that is no longer maintained.

This project also includes a fairly complete set of examples equivalent to the ones in the C++ repository.

It is quite possible to use this crate directly from your Rust code, but it will mean littering unsafe all over the place. Instead it is recommended that you use the safe wrapper of this interface: cassandra-cpp.

Documentation (crates.io).

Getting started

For the wrapper 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.

You can use this crate from cargo as cassandra-cpp-sys.

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.

Compilation

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

By default, /usr/lib, /usr/local/lib64, and /usr/local/lib are added to the linker search path.

A semicolon separated list of additional directories to add to the linker search path may be specified through the CASSANDRA_SYS_LIB_PATH environment variable.

Feature flags

This crate includes the feature flag early_access_min_tls_version, which allows you to build against a version of the DataStax driver including the cass_ssl_set_min_protocol_version method, as defined in this PR. You must have a version of the driver supporting this installed local to be able to compile (and run) with this feature flag.

When this this feature is available in the mainline driver this flag will be set to do nothing and deprecated, and the functions will be added to the main library. The flag will then be retired in the next breaking change.

Autogeneration

The file cassandra.rs is autogenerated as follows:

$ bindgen --no-layout-tests --blacklist-type=max_align_t --rustified-enum=.* --output=src/cassandra.rs cassandra.h

The autogenerated code is formatted with rustfmt.

History

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

Dependencies