CouchDB client-side library for the Rust programming language

Related tags

Database chill
Overview

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 design goals are convenience, safety, and efficiency.

You can read more about its design and development here:

Roadmap

Chill's most recent release is v0.3.0, available as of 2016-10-01.

The next release will be v0.4.0 and will entail:

  • A much-needed refresh of dependencies, Serde v1.x perhaps being the most important, and,
  • Possibly an overhaul of the API to support asynchronous I/O via the Tokio model.

License

Chill is licensed under either of:

Feedback

Do you find this crate useful? Not useful? Please send feedback!

Comments
  • Consider generalizing the transport layer regarding queries and bodies

    Consider generalizing the transport layer regarding queries and bodies

    Currently, the transport layer is specific to the CouchDB API. For example, the RequestOptions struct contains values for CouchDB-specific query parameters. Consequently, to add support for a new query parameter, the programmer must extend RequestOptions by adding a new field, as well as touching several other points in the transport layer to handle that new field.

    transport 
    opened by cmbrandenburg 2
  • Delay handling of path parsing errors?

    Delay handling of path parsing errors?

    Currently, executing an action requires unwrapping of two results:

    let foo = db.action().unwrap().run().unwrap();
    

    For some actions, there are a few more, like when you're receiving a document:

    let content = foo.get_conent().unwrap();
    

    This results in a lot of nested try! calls. IMO, we should change the actions to return Self and store the path as Result<Path, Error> that gets unwrapped in run(). That's also how hyper does it.

    duplicate 
    opened by jgillich 2
  • Consider simplifying type parameterization for view execution

    Consider simplifying type parameterization for view execution

    The ExecuteView action, along with related types such as ViewResponse, require applications to explicitly provide Key and Value type parameters. Consider changing the API to allow for type inference.

    breaking change 
    opened by cmbrandenburg 2
  • Simplify path-related types

    Simplify path-related types

    The path-related types should be as convenient to use as possible while retaining strong type-safety to guard against, say, a programmer mistakenly referencing a normal document when a design document is needed. See my commentary below for what this means specifically.

    ~~As they're currently implemented, the path-related types cannot all implement Borrow. E.g., impl std::borrow::Borrow<DocumentPathRef> for DocumentPath makes no sense. One consequence is that when these types are stored as keys in a HashMap, each lookup into that collection requires a temporary heap allocation.~~

    ~~Here's the relevant StackOverflow question: http://stackoverflow.com/q/36480845/1094609~~

    ~~By using a Cow as the underlying storage for path-related types, we could implement Borrow. We could also eliminate the distinction between owning-types and borrowing-types—e.g., DocumentPath and DocumentPathRef<'a> would collapse into a single DocumentPath<'a> type. However, one downside is that the new type would require a lifetime parameter, which may be too bitter a pill to swallow.~~

    breaking change 
    opened by cmbrandenburg 1
  • New support for including the document in each view row

    New support for including the document in each view row

    Add support for the include_docs query parameter when executing a view. Doing so will require changing the ViewRow type to optionally contain a Document.

    ~~It might be a good idea—either now or later—to make a new reference-counted document path type, similar to DocumentPath, whereby the database name component is stored as a std::rc::Rc<DatabaseName>. Otherwise, each view row containing a document will have a copy of the same database name, which could lead to a lot of allocations. I envision the reference-counted document path type to be an private type inside Chill.~~

    The reference-counting idea is probably a bad idea. The std::rc::Rc type implements !Send, meaning Rc prevents anything containing it from moving to another thread. Having a Document (or ViewRow) contain an Rc would be prioritizing for efficiency over convenience—contrary to the central aim for Chill. For this specific case, it would be better merely to incur the cost of one extra allocation per document for the database name, as that cost will be lost in the noise of doing an HTTP round-trip with the CouchDB server.

    couchdb API coverage 
    opened by cmbrandenburg 1
  • New types for representing design document content

    New types for representing design document content

    Define a set of types that applications may use to represent design documents or parts of design documents. E.g.,

    pub struct Design {
        pub views: HashMap<String, ViewFunction>,
        // ...
    }
    
    couchdb API coverage 
    opened by cmbrandenburg 1
  • Add support to ViewResponse for group-reduced views

    Add support to ViewResponse for group-reduced views

    Here are the issues for adding support for group-reduced views: #23 and #24.

    ~~Group-reduced views are technically reduced, but, structurally, their responses have the same form as unreduced views in that they consist of an array of key–value pairs.~~ Correction: Group-reduced view responses lack the total_rows and offset fields.

    ~~Instead of distinguishing the two view variants by reduced vs unreduced, we should distinguish by scalar (i.e., value only) vs non-scalar (i.e., array of key–value pairs).~~

    Group-reduced view responses may have multiple rows, with each row containing a non-null key and a value. Currently, Chill's ViewResponse enum has two variants, Reduced and Unreduced, with the reduced variant having exactly one value.

    It may make sense to convert ViewResponse from an enum to a struct, thereby eliminating the distinction between reduced and unreduced views.

    breaking change 
    opened by cmbrandenburg 0
  • Consider making the action-constructing methods infallible

    Consider making the action-constructing methods infallible

    Currently, all Client methods that construct an action do so fallibly, returning a Result. For ergonomics, consider pushing fallibility to the time that the action executes so that the Client method always succeeds and returns the action type.

    breaking change 
    opened by cmbrandenburg 0
  • ViewResponse should implement Send

    ViewResponse should implement Send

    ViewRow contains an Rc<DatabaseName> as an optimization. However, this has the effect of making the ViewRow implement !Send. See #19 for more commentary.

    I.e., the follow snippet causes a compile-time error:

    fn f<T: Send>(_: T) {}
    f(ViewResponse::Reduced(ReducedView {
        update_seq: None,
        value: 42,
    }));
    
    bug 
    opened by cmbrandenburg 0
  • New support for getting attachments as part of reading a document

    New support for getting attachments as part of reading a document

    Add support for optionally including attachment content as part of reading a document. This can at first be implemented by using the ?attachments query parameter for GET /db/doc, though long-term this should be implemented using multipart.

    A lot of the infrastructure for handling document attachments is already implemented as of v0.1.0, but some design work will need to be done to expose the attachments via the Chill API.

    couchdb API coverage 
    opened by cmbrandenburg 0
  • Replace AttachmentName type alias with a real type

    Replace AttachmentName type alias with a real type

    The Document type relies on an AttachmentName type aliased to a String. Replace this with a real AttachmentName type (analogous to the DatabaseName type). Here's a snapshot of the source.

    It makes the most sense to resolve this when Chill's API gains support for attachments.

    couchdb API coverage 
    opened by cmbrandenburg 0
  • Support for specifing view keys (start, end, …) by reference

    Support for specifing view keys (start, end, …) by reference

    Currently, applications specify start and end keys for views only by value.

    Chill should also support specifying keys by reference so as to eliminate a key copy in some cases.

    chill API 
    opened by cmbrandenburg 0
  • Consider adding a general `ExecuteAction::with_end_key` method

    Consider adding a general `ExecuteAction::with_end_key` method

    Currently, the ExecuteAction has two methods for setting the “end key”:

    • with_end_key_inclusive
    • with_end_key_exclusive

    Consider generalizing both methods into one method—something like:

    fn with_end_key<K>(self, end_key: K, inclusivity: ???) -> Self

    The ??? may be a marker type, with one type denoting inclusivity and another denoting exclusivity.

    ~~Note another change: the key parameter is a reference, not a value.~~

    chill API 
    opened by cmbrandenburg 0
  • Document attachments should all be `Saved` after updating a document

    Document attachments should all be `Saved` after updating a document

    After successfully running the UpdateDocument action, Chill should change any unsaved attachments in the document to the Saved variant. Otherwise, Chill may redundantly upload the attachment if the document is updated again.

    bug breaking change 
    opened by cmbrandenburg 1
  • New action to forcibly overwrite a document if changed

    New action to forcibly overwrite a document if changed

    This action would not model an HTTP action in the CouchDB API. Instead, it would comprise two CouchDB actions: (1) reading a document, followed by (2) overwriting the document if and only if the document's content (read in step 1) is different than the new content provided by the application.

    The intended purpose of this new action is to make it easier for applications to keep design documents up-to-date. Applications would, upon startup, run this action once for each design document, with the result that only out-of-date design documents would be overwritten.

    Beyond the scope of this issue, it may make sense to provide another action, one that forcibly overwrites multiple documents. This new action would read via an HTTP POST request to the _all_docs resource (to read multiple specific documents by id), followed by updating some of the documents via an HTTP POST request to _bulk_docs.

    transport chill API 
    opened by cmbrandenburg 1
  • Improve error messages to include action name

    Improve error messages to include action name

    Currently (as of v0.2.0), when an action fails, the resulting error message does not include the action name. Consequently, if the application runs many actions and one fails, then it's not immediately clear which action failed.

    breaking change 
    opened by cmbrandenburg 1
  • Optimize ViewRow to not clone and re-decode key and value

    Optimize ViewRow to not clone and re-decode key and value

    Currently, ViewRow clones and re-decodes (from JSON) the row's key and value in its key and value methods. It map be better to avoid this duplication of effort. Perhaps we could store the raw JSON text and do the decoding only once, during the call to key or value.

    optimization 
    opened by cmbrandenburg 0
Owner
null
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
Sofa - CouchDB for Rust

Sofa - CouchDB for Rust Documentation Here: http://docs.rs/sofa Installation [dependencies] sofa = "0.6" Description This crate is an interface to Cou

66 Origin 40 Feb 11, 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
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
Affine-client is a client for AFFINE based on Tauri

Affine Client affine-client is a client for AFFINE based on Tauri Supported Platforms Windows Linux MacOS Download https://github.com/m1911star/affine

Horus 216 Dec 25, 2022
Native PostgreSQL driver for the Rust programming language

Rust-Postgres PostgreSQL support for Rust. postgres Documentation A native, synchronous PostgreSQL client. tokio-postgres Documentation A native, asyn

Steven Fackler 2.8k Jan 8, 2023
Bind the Prisma ORM query engine to any programming language you like ❤️

Prisma Query Engine C API Bind the Prisma ORM query engine to any programming language you like ❤️ Features Rust bindings for the C API Static link li

Prisma ORM for community 10 Dec 15, 2022
Bind the Prisma ORM query engine to any programming language you like ❤️

Prisma Query Engine C API Bind the Prisma ORM query engine to any programming language you like ❤️ Features Rust bindings for the C API Static link li

Odroe 6 Sep 9, 2022
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
rinflux is Rust based influx client implementation that have been inspired from influx other language implementation, developed with 💖

Unofficial InfluxDB Driver for Rust This library is a work in progress. This means a feature you might need is not implemented yet or could be handled

Workfoxes 1 Apr 7, 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
Mysql client library implemented in rust.

mysql This crate offers: MySql database driver in pure rust; connection pool. Features: macOS, Windows and Linux support; TLS support via nativetls cr

Anatoly I 548 Dec 31, 2022
Skytable rust client support library for the bb8 connection pool

bb8-skytable Skytable rust client support library for the bb8 connection pool. Heavily based on bb8-redis Basic usage example use bb8_skytable::{

null 3 Sep 18, 2021
OBKV Table Client is Rust Library that can be used to access table data from OceanBase storage layer.

OBKV Table Client is Rust Library that can be used to access table data from OceanBase storage layer. Its access method is different from JDBC, it skips the SQL parsing layer, so it has significant performance advantage.

OceanBase 4 Nov 14, 2022
rustodrive is a rust client library for communicating with ODrives using the CAN protocol.

rustodrive is a WIP client library for communicating with ODrives using the CAN protocol. It is more than a simple CAN sender/receiver and has many co

null 5 Oct 31, 2022
An async-ready Phoenix Channels v2 client library in Rust

Phoenix Channels This crate implements a Phoenix Channels (v2) client in Rust. Status NOTE: This client is still a work-in-progress, though it has eno

LiveView Native 22 Jan 7, 2023
LDAP client library

LDAP client library A pure-Rust LDAP client library using the Tokio stack. Compatibility with Tokio versions Tokio 1.0 is the long-term stable version

null 166 Jan 4, 2023
Async Lightweight HTTP client using system native library if possible. (Currently under heavy development)

Async Lightweight HTTP Client (aka ALHC) What if we need async but also lightweight http client without using such a large library like reqwest, isahc

SteveXMH 7 Dec 15, 2022
A simple, workable RCS client library.

rust-rcs-client A simple, workable RCS client library. RCS capabilities are mainly provided by your cellular network. This is a working client side im

EverfrosT 3 Jul 6, 2023