Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/alexpikalov/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
https://github.com/alexpikalov/cdrs
cassandra cdrs client database driver rust
Last synced: 14 days ago
JSON representation
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
- Host: GitHub
- URL: https://github.com/alexpikalov/cdrs
- Owner: AlexPikalov
- License: apache-2.0
- Created: 2016-10-22T18:30:53.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2021-02-18T12:08:42.000Z (over 3 years ago)
- Last Synced: 2024-10-28T00:24:11.326Z (16 days ago)
- Topics: cassandra, cdrs, client, database, driver, rust
- Language: Rust
- Homepage:
- Size: 1.89 MB
- Stars: 342
- Watchers: 20
- Forks: 58
- Open Issues: 34
-
Metadata Files:
- Readme: README.md
- Changelog: changelog.md
- Funding: .github/FUNDING.yml
- License: LICENSE-APACHE
Awesome Lists containing this project
README
# CDRS [![crates.io version](https://img.shields.io/crates/v/cdrs.svg)](https://crates.io/crates/cdrs) [![Build Status](https://travis-ci.org/AlexPikalov/cdrs.svg?branch=master)](https://travis-ci.org/AlexPikalov/cdrs) [![Build status](https://ci.appveyor.com/api/projects/status/sirj4flws6o0dvb7/branch/master?svg=true)](https://ci.appveyor.com/project/harrydevnull/cdrs/branch/master)
## CDRS is looking for maintainers
CDRS is Apache **C**assandra **d**river written in pure **R**u**s**t.
π‘Looking for an async version?
- async-std https://github.com/AlexPikalov/cdrs-async (API is not fully compatible with https://github.com/AlexPikalov/cdrs)
- tokio https://github.com/AlexPikalov/cdrs/tree/async-tokio## Features
- TCP/SSL connection;
- Load balancing;
- Connection pooling;
- LZ4, Snappy compression;
- Cassandra-to-Rust data deserialization;
- Pluggable authentication strategies;
- [ScyllaDB](https://www.scylladb.com/) support;
- Server events listening;
- Multiple CQL version support (3, 4), full spec implementation;
- Query tracing information.## Documentation and examples
- [User guide](./documentation).
- [Examples](./examples).
- API docs (release).
- Using ScyllaDB with RUST [lesson](https://university.scylladb.com/courses/using-scylla-drivers/lessons/rust-and-scylla/).## Getting started
Add CDRS to your `Cargo.toml` file as a dependency:
```toml
cdrs = { version = "2" }
```Then add it as an external crate to your `main.rs`:
```rust
extern crate cdrs;use cdrs::authenticators::NoneAuthenticator;
use cdrs::cluster::session::{new as new_session};
use cdrs::cluster::{ClusterTcpConfig, NodeTcpConfigBuilder};
use cdrs::load_balancing::RoundRobin;
use cdrs::query::*;fn main() {
let node = NodeTcpConfigBuilder::new("127.0.0.1:9042", NoneAuthenticator {}).build();
let cluster_config = ClusterTcpConfig(vec![node]);
let no_compression =
new_session(&cluster_config, RoundRobin::new()).expect("session should be created");let create_ks: &'static str = "CREATE KEYSPACE IF NOT EXISTS test_ks WITH REPLICATION = { \
'class' : 'SimpleStrategy', 'replication_factor' : 1 };";
no_compression.query(create_ks).expect("Keyspace create error");
}
```This example configures a cluster consisting of a single node, and uses round robin load balancing and default `r2d2` values for connection pool.
## License
This project is licensed under either of
- Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or [http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0))
- MIT license ([LICENSE-MIT](LICENSE-MIT) or [http://opensource.org/licenses/MIT](http://opensource.org/licenses/MIT))at your option.