Skip to content
This repository was archived by the owner on Sep 28, 2020. It is now read-only.

mibes/sofa

 
 

Repository files navigation

Sofa - CouchDB for Rust

Crates.io FOSSA Status

docs.rs

sofa-logo

Migration Notice

Please note that we are no longer maintaining this fork, but have spun off a new project: couch-rs

Documentation

Here: http://docs.rs/sofa

Installation

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"

Description

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.

Example code

You can launch the included example with:

cargo run --example basic_operations

Running tests

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.

Why the name "Sofa"

CouchDB has a nice name, and I wanted to reflect that.

License

Licensed under either of these:

FOSSA Status

Yellow Innovation

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.

Yellow Innovation's website and works

About

Sofa - CouchDB for Rust

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

0 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors

Languages

  • Rust 100.0%