{"id":23577508,"url":"https://github.com/couchbaselabs/couchbase-rs","last_synced_at":"2025-05-16T00:08:46.945Z","repository":{"id":15299060,"uuid":"77853977","full_name":"couchbaselabs/couchbase-rs","owner":"couchbaselabs","description":"The official, community supported Couchbase Rust SDK","archived":false,"fork":false,"pushed_at":"2025-05-01T12:24:56.000Z","size":11679,"stargazers_count":111,"open_issues_count":35,"forks_count":31,"subscribers_count":78,"default_branch":"master","last_synced_at":"2025-05-11T03:11:35.114Z","etag":null,"topics":["couchbase","couchbase-rust-sdk","libcouchbase","rust","sdk"],"latest_commit_sha":null,"homepage":"https://couchbase.com","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/couchbaselabs.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2017-01-02T18:37:24.000Z","updated_at":"2025-04-16T23:25:10.000Z","dependencies_parsed_at":"2024-04-17T09:38:13.289Z","dependency_job_id":"5a6c82c0-6fe8-4834-ac54-adb24f9a22b8","html_url":"https://github.com/couchbaselabs/couchbase-rs","commit_stats":{"total_commits":312,"total_committers":7,"mean_commits":44.57142857142857,"dds":"0.28525641025641024","last_synced_commit":"e95d5251574d64b0841b644ff22e33db282baa77"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/couchbaselabs%2Fcouchbase-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/couchbaselabs%2Fcouchbase-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/couchbaselabs%2Fcouchbase-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/couchbaselabs%2Fcouchbase-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/couchbaselabs","download_url":"https://codeload.github.com/couchbaselabs/couchbase-rs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254442854,"owners_count":22071878,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["couchbase","couchbase-rust-sdk","libcouchbase","rust","sdk"],"created_at":"2024-12-26T22:29:22.623Z","updated_at":"2025-05-16T00:08:41.903Z","avatar_url":"https://github.com/couchbaselabs.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Couchbase Rust SDK\n\n## Deprecation notice\n\nThis branch/version of the SDK is deprecated in favor of a fully native version that is currently in development on\nthe [nativex branch](https://github.com/couchbaselabs/couchbase-rs/tree/nativex).\nOnce the native SDK is considered to be complete enough it will be moved into this (master) branch.\n\n[![LICENSE](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](LICENSE)\n[![Crates.io Version](https://img.shields.io/crates/v/couchbase.svg)](https://crates.io/crates/couchbase)\n\n## Requirements\n\nMake sure to have all [libcouchbase](https://docs.couchbase.com/c-sdk/current/start-using-sdk.html) requirements satisfied to build it properly. Also [bindgen](https://rust-lang.github.io/rust-bindgen/requirements.html) requirements need to be in place. You need a rust version newer or equal to `1.77.2` because this SDK makes heavy use of `async/await`.\n\n## Installation\n\n```toml\n[dependencies]\ncouchbase = \"1.0.0-alpha.5\"\n```\n\n## Usage\n\nThe `examples` folder has a bunch more, but here is a basic getting started doing a kv op:\n\n```rust\npub fn main() {\n    // Connect to the cluster with a connection string and credentials\n    let cluster = Cluster::connect(\"couchbase://127.0.0.1\", \"Administrator\", \"password\");\n    // Open a bucket\n    let bucket = cluster.bucket(\"travel-sample\");\n    // Use the default collection (needs to be used for all server 6.5 and earlier)\n    let collection = bucket.default_collection();\n\n    // Fetch a document\n    match block_on(collection.get(\"airline_10\", GetOptions::default())) {\n        Ok(r) =\u003e println!(\"get result: {:?}\", r),\n        Err(e) =\u003e println!(\"get failed! {}\", e),\n    };\n\n    // Upsert a document as JSON\n    let mut content = HashMap::new();\n    content.insert(\"Hello\", \"Rust!\");\n\n    match block_on(collection.upsert(\"foo\", content, UpsertOptions::default())) {\n        Ok(r) =\u003e println!(\"upsert result: {:?}\", r),\n        Err(e) =\u003e println!(\"upsert failed! {}\", e),\n    };\n}\n```\n\n## Examples\n\nMore examples can be found in the `examples` folder. Please open a ticket if something is not present or does not\nshowcase what you need.\n\n## Unsafe Code\n\nThis code contains **unsafe {}** code blocks. Breathe slowly and calm down, it's going to be okay. The reason why we use\nunsafe code is so that we can call into `libcouchbase` which is a C library. The only unsafe code is found in the lcb\npart of the IO module. So if you experience a segfault, it will likely come from there. We are trying to even keep\nunsafe in there minimal, but by the nature of it, it is all over the place. We are also working on a pure Rust SDK with\nno unsafe code (hopefully), but until this ships and is mature we have to live with it.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcouchbaselabs%2Fcouchbase-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcouchbaselabs%2Fcouchbase-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcouchbaselabs%2Fcouchbase-rs/lists"}