Please note that we are no longer maintaining this fork, but have spun off a new project: couch-rs
Here: http://docs.rs/sofa
If you want to use this particular fork, include this dependency in the Cargo.toml file:
[dependencies]
sofa = { git = "https://github.com/mibes/sofa.git", version = "0.8.0" }
If you want to continue to use the "old" 0.6 version use this dependency instead:
[dependencies]
sofa = "0.6"
This crate is an interface to CouchDB HTTP REST API. Works with stable Rust.
After trying most crates for CouchDB in Rust (chill
, couchdb
in particular), none of them fit our needs hence the need to create our own.
Uses async I/O, with a mix of Reqwest and Serde under the hood, and a few nice abstractions out there.
NOT 1.0 YET, so expect changes
Supports CouchDB 2.3.0 and up, including the newly released 3.0 version.
Be sure to check CouchDB's Documentation in detail to see what's possible.
The 0.7 version is based on the 0.6 release from https://github.com/YellowInnovation/sofa. It has been updated to the Rust 2018 edition standards, uses async I/O, and compiles against the latest serde and reqwest libraries.
You can launch the included example with:
cargo run --example basic_operations
Make sure that you have an instance of CouchDB 2.0+ running, either via the supplied docker-compose.yml
file or by yourself. It must be listening on the default port.
Since Couch 3.0 the "Admin Party" mode is no longer supported. This means you need to provide a username and password during launch.
The tests and examples assume an "admin" CouchDB user with a "password" CouchDB password. Docker run command:
docker run --rm -p 5984:5984 -e COUCHDB_USER=admin -e COUCHDB_PASSWORD=password couchdb:3
And then
cargo test -- --test-threads=1
Single-threading the tests is very important because we need to make sure that the basic features are working before actually testing features on dbs/documents.
CouchDB has a nice name, and I wanted to reflect that.
Licensed under either of these:
- Apache License, Version 2.0, (LICENSE-APACHE or https://www.apache.org/licenses/LICENSE-2.0
- MIT license (LICENSE-MIT or https://opensource.org/licenses/MIT)
Yellow Innovation is the innovation laboratory of the French postal service: La Poste.
We create innovative user experiences and journeys through services with a focus on IoT lately.