Sofa - CouchDB for Rust

Overview

Sofa - CouchDB for Rust

Crates.io FOSSA Status

docs.rs

sofa-logo

Documentation

Here: http://docs.rs/sofa

Installation

[dependencies]
sofa = "0.6"

Description

This crate is an interface to CouchDB HTTP REST API. Works with stable Rust.

Does not support #![no_std]

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.

No async I/O (yet), uses a mix of Reqwest and Serde under the hood, with a few nice abstractions out there.

NOT 1.0 YET, so expect changes

Supports CouchDB 2.0 and up.

Be sure to check CouchDB's Documentation in detail to see what's possible.

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.

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

Comments
  • clean all potentially panicking unwraps

    clean all potentially panicking unwraps

    Here's my attempt at this for #3 !

    The crux is leveraging the failure crate.

    I was not able to eliminate unwrap in the following:

    • DocumentCollection::index
    • DocumentCollection::index_mut
    • Model::from_document
    • Model::to_document
    • All instances of unwrap in tests remain

    Additionally, I was not able to figure out how to run all the tests as they seemed to be interfering with each other. So, each test uses it's own database.

    Feedback and modifications welcome! 😀

    opened by travismiller 2
  • Update README.md

    Update README.md

    With new update to 0.5.2, the readme still showed 0.5.1. Instead of changing it, it is better to stick to "0.5" (as "0.5" means "^0.5.0" it shouldn't be a problem). The only issue is you have breaking changes from 0.5.x to the 0.5.(x+1) then the users have to specify the entire version.

    opened by Dylan-DPC-zz 1
  • Add license scan report and status

    Add license scan report and status

    Your FOSSA integration was successful! Attached in this PR is a badge and license report to track scan status in your README.

    Below are docs for integrating FOSSA license checks into your CI:

    opened by fossabot 0
  • Clean all potentially panicking unwraps

    Clean all potentially panicking unwraps

    In the codebase, there are 66 occurences of unwrap(), including most of them panicking if there's a problem with SSL/Requests.

    Cleaning up will take place in 0.6.0 since it might break the API a bit (eg: returning Result<T, E> instead of T)

    enhancement help wanted 
    opened by OtaK 0
  • Updated Sofa 0.6 to use tokio-async, latest serde and reqwest libraries and follow 2018 standard

    Updated Sofa 0.6 to use tokio-async, latest serde and reqwest libraries and follow 2018 standard

    Hi,

    We're using your excellent library in one of our solutions. We did have to make some changes to integrate it into the tokio async framework. The library has been "upgraded" to use the latest serde and reqwest libraries.

    We've also added some examples to illustrate the use of the library.

    Kind regards, Marcel

    opened by mibes 1
  • Adopt and update to reqwest 0.9.x mainly to support latest OpenSSL versions

    Adopt and update to reqwest 0.9.x mainly to support latest OpenSSL versions

    Hi, I just updated from reqwest 0.8.x to 0.9.x to be able compile sofa in my dev environment running on Ubuntu 18.04 LTS and Arch Linux without any issues regarding the version of the OpenSSL library. Please review my code changes. I'm not so familiar with Rust yet. Thank you. Kind regaards, Tobias

    opened by tokcum 2
  • add basic authentication

    add basic authentication

    fixes #6 this is a real basic implementation, i'm not too familiar with reqwest or couchdb. It's enough for my use case, but I expect this to need some love before it can be merged.

    enhancement 
    opened by danieleades 0
  • potentially pointless method

    potentially pointless method

    what is the purpose of the get_self(...) method on Client?

        pub fn get_self(&mut self) -> &mut Self {
            self
        }
    

    it returns a mutable reference to self, but you can only call the method if you already have a mutable reference to self.

    opened by danieleades 0
  • Generic arguments

    Generic arguments

    fixes #7 I've made most of the functions generic over the input they actually need, rather than concrete types. I think there's still some work to be done to improve the api.

    this is a minor breaking change as seen below-

    before

    fn example(s: String) {
       let x: String = s;
    }
    
    fn main() {
       let my_str : &'static str = "example string";
    
      // this won't compile after the change as type ascriptions would be required to determine how to apply 'into()'
       example(my_str.into())
    }
    

    after

    fn example<S: Into<String>>(s: S) {
       let x: String = s.into();
    }
    
    fn main() {
       let my_str : &'static str = "example string";
    
      // consumer of library can now use any type which can be converted into a concrete string to call the function
       example(my_str)
    }
    
    opened by danieleades 0
Releases(v0.6.0)
Owner
66 Origin
66 Origin
CouchDB client-side library for the Rust programming language

Chill Chill is a client-side CouchDB library for the Rust programming language, available on crates.io. It targets Rust Stable. Chill's three chief de

null 35 Jun 26, 2022
A programmable document database inspired by CouchDB written in Rust

PliantDB PliantDB aims to be a Rust-written, ACID-compliant, document-database inspired by CouchDB. While it is inspired by CouchDB, this project will

Khonsu Labs 718 Dec 31, 2022
CouchDB client library for the Rust programming language

CouchDB This project is reborn! As of its v0.6.0 release, the couchdb crate has new life as a toolkit instead of providing a full-blown client. In a n

null 20 Jul 17, 2021
A programmable document database inspired by CouchDB written in Rust

BonsaiDb Formerly known as PliantDb. Not yet released on crates.io as BonsaiDb. BonsaiDb aims to be a Rust-written, ACID-compliant, document-database

Khonsu Labs 721 Jan 2, 2023
🧰 The Rust SQL Toolkit. An async, pure Rust SQL crate featuring compile-time checked queries without a DSL. Supports PostgreSQL, MySQL, SQLite, and MSSQL.

SQLx ?? The Rust SQL Toolkit Install | Usage | Docs Built with ❤️ by The LaunchBadge team SQLx is an async, pure Rust† SQL crate featuring compile-tim

launchbadge 7.6k Dec 31, 2022
Redis re-implemented in Rust.

rsedis Redis re-implemented in Rust. Why? To learn Rust. Use Cases rsedis does not rely on UNIX-specific features. Windows users can run it as a repla

Sebastian Waisbrot 1.6k Jan 6, 2023
A generic connection pool for Rust

r2d2 A generic connection pool for Rust. Documentation Opening a new database connection every time one is needed is both inefficient and can lead to

Steven Fackler 1.2k Jan 8, 2023
An ArangoDB driver for Rust

Rincon Rincon is an ArangoDB driver for Rust. It enables low level access to ArangoDB in a typesafe and Rust idiomatic manner. The name Rincon is deri

Innoave 35 Mar 21, 2021
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

CDRS CDRS is looking for maintainers CDRS is Apache Cassandra driver written in pure Rust. ?? Looking for an async version? async-std https://github.c

Alex Pikalov 338 Jan 1, 2023
Cassandra (CQL) driver for Rust, using the DataStax C/C++ driver under the covers.

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 cra

null 93 Jan 7, 2023
⚡🦀 🧨 make your rust types fit DynamoDB and visa versa

?? ?? dynomite dynomite makes DynamoDB fit your types (and visa versa) Overview Goals ⚡ make writing dynamodb applications in rust a productive experi

Doug Tangren 197 Dec 15, 2022
A Rust client for the ElasticSearch REST API

rs-es Introduction An ElasticSearch client for Rust via the REST API. Targetting ElasticSearch 2.0 and higher. Other clients For later versions of Ela

Ben Ashford 218 Dec 27, 2022
An Elasticsearch REST API client for Rust

elastic elastic is an efficient, modular API client for Elasticsearch written in Rust. The API is targeting the Elastic Stack 7.x. elastic provides st

null 249 Oct 18, 2022
An etcd client library for Rust.

etcd An etcd client library for Rust. etcd on crates.io Documentation for the latest crates.io release Running the tests Install Docker and Docker Com

Jimmy Cuadra 138 Dec 27, 2022
etcd for rust

etcd for Rust An etcd(API v3) client for Rust, and it provides async/await APIs backed by tokio and tonic. Documentation on the library can be found a

ccc 159 Dec 30, 2022
Rust bindings for LMDB

lmdb-rs Rust bindings for LMDB Documentation (master branch) Building LMDB is bundled as submodule so update submodules first: git submodule update --

Valerii Hiora 104 Dec 8, 2022
The official MongoDB Rust Driver

MongoDB Rust Driver This repository contains the officially supported MongoDB Rust driver, a client side library that can be used to interact with Mon

mongodb 1.1k Dec 30, 2022
Redis library for rust

redis-rs Redis-rs is a high level redis library for Rust. It provides convenient access to all Redis functionality through a very flexible but low-lev

Armin Ronacher 2.8k Jan 8, 2023
rust wrapper for rocksdb

rust-rocksdb Requirements Clang and LLVM Contributing Feedback and pull requests welcome! If a particular feature of RocksDB is important to you, plea

null 1.3k Dec 30, 2022