GithubHelp home page GithubHelp logo

isabella232 / mongo-rust-driver-1 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from appsignal/mongo-rust-driver

0.0 0.0 0.0 267 KB

Mongo Rust driver built on top of the Mongo C driver

License: Apache License 2.0

Rust 100.00%

mongo-rust-driver-1's Introduction

Mongo Rust Driver

Crate

Mongo Rust driver built on top of the Mongo C driver. This driver is a thin wrapper around the production-ready C driver that provides a safe and ergonomic Rust interface which handles all the gnarly usage details of the C driver for you.

Bson encoding and decoding is handled by the bson crate, the bindings are based on generated bindings by bindgen.

The API should still be considered experimental, but I'm not expecting changes at the moment.

Documentation

Compatibility

The driver currently only builds on Unix, tested on Mac Os X and Linux so far. It's compatible with MongoDB 2.6 up to 3.4 and has full replica set and SSL support.

Installation

If you have any trouble installing the crate (linking openssl can be tricky) please check out the installation instructions for the C driver.

To build on Mac install OpenSSL 1.1 and cmake:

brew install [email protected]
brew install cmake

Export these env vars the before you make a clean build:

export LDFLAGS="-L/usr/local/opt/[email protected]/lib"
export CPPFLAGS="-I/usr/local/opt/[email protected]/include"
export PKG_CONFIG_PATH="/usr/local/opt/[email protected]/lib/pkgconfig"

Logging

All internal logging by mongoc is redirected to the macros in the log crate. See the log docs to configure output in your application.

SSL test

There is a test included to connect to a replica set over SSL. To skip this test:

SKIP_SSL_CONNECTION_TESTS=true cargo test

To run this tests fill these environment variables with something appropiate to connect to a replica set:

MONGO_RUST_DRIVER_SSL_URI
MONGO_RUST_DRIVER_SSL_PEM_FILE
MONGO_RUST_DRIVER_SSL_CA_FILE

Examples

See the tests directory for examples of how to use the driver.

License

Licensed under either of

at your option.

Contribution

Contributions are very welcome, only the functionality we use has been wrapped so far. Please write a test for any behavior you add.

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

mongo-rust-driver-1's People

Contributors

ayosec avatar brokenthorn avatar inv2004 avatar matrix-zhang avatar matsimitsu avatar mjjansen avatar thijsc avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.