{"id":13797472,"url":"https://github.com/durch/rust-bigtable","last_synced_at":"2025-05-13T04:31:52.806Z","repository":{"id":54484482,"uuid":"78246512","full_name":"durch/rust-bigtable","owner":"durch","description":"Rust library for working with Google Bigtable Data API","archived":false,"fork":false,"pushed_at":"2021-02-16T09:17:59.000Z","size":22318,"stargazers_count":22,"open_issues_count":2,"forks_count":8,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-11T19:10:18.092Z","etag":null,"topics":["bigtable","google-bigtable","rust-library"],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/durch.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-01-06T23:27:48.000Z","updated_at":"2024-01-05T14:31:23.000Z","dependencies_parsed_at":"2022-08-13T17:20:48.017Z","dependency_job_id":null,"html_url":"https://github.com/durch/rust-bigtable","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/durch%2Frust-bigtable","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/durch%2Frust-bigtable/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/durch%2Frust-bigtable/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/durch%2Frust-bigtable/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/durch","download_url":"https://codeload.github.com/durch/rust-bigtable/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225023915,"owners_count":17408774,"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":["bigtable","google-bigtable","rust-library"],"created_at":"2024-08-04T00:00:21.706Z","updated_at":"2024-11-18T12:31:16.334Z","avatar_url":"https://github.com/durch.png","language":"Rust","funding_links":[],"categories":["Tools"],"sub_categories":["Other Client Libraries"],"readme":"[![](https://travis-ci.org/durch/rust-bigtable.svg?branch=master)](https://travis-ci.org/durch/rust-bigtable)\n[![](http://meritbadge.herokuapp.com/bigtable)](https://crates.io/crates/bigtable)\n[![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/durch/rust-bigtable/blob/master/LICENSE.md)\n[![Join the chat at https://gitter.im/durch/rust-bigtable](https://badges.gitter.im/durch/rust-bigtable.svg)](https://gitter.im/durch/rust-bigtable?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge)\n[![Mentioned in Awesome Bigtable](https://awesome.re/mentioned-badge-flat.svg)](https://github.com/zrosenbauer/awesome-bigtable)\n\n## rust-bigtable [[docs](https://durch.github.io/rust-bigtable/)]\n\nRust library for working with [Google Bigtable](https://cloud.google.com/bigtable/docs/) [Data API](https://cloud.google.com/bigtable/docs/reference/data/rpc/google.bigtable.v2)\n\n### Intro\nInterface towards Cloud Bigtable, supports all [Data API](https://cloud.google.com/bigtable/docs/reference/data/rpc/google.bigtable.v2) methods. \n\n+ CheckAndMutateRow\n+ MutateRow\n+ MutateRows\n+ ReadModifyWriteRow\n+ ReadRows\n+ SampleRowKeys\n\nIncludes support for [JWT auth](https://cloud.google.com/docs/authentication):\n\n### How it works\n\nInitial plans was to go full `grpc` over `http/2`, unfortunately Rust support is not there yet, so a middle way was taken :).\n\nRequests objects are `protobuf` messages, generated using `proto` definitions available from [Google](https://github.com/googleapis/googleapis/blob/master/google/bigtable/v2/bigtable.proto). And all configuration is done through very nice interfaces generated in this way. These messages are then transparently converted to `json`, and sent to predefined `google.api.http` endpoints, also defined [here](https://github.com/googleapis/googleapis/blob/master/google/bigtable/v2/bigtable.proto). Responses are returned as [serde_json::Value](https://docs.serde.rs/serde_json/value/index.html).\n\nIn theory this should enable easy upgrade to full `grpc` over `http/2` as soon as it becomes viable, the only remaining work would be utilising proper return types, also available as `protobuf` messages.\n\n### Configuration\n\nYou can provide the `json` service accounts credentials obtained from Google Cloud Console or the private key file in `pem` or (see [random_rsa_for_testing](https://github.com/durch/rust-bigtable/blob/master/random_rsa_for_tests) for proper format) format as well as Google Cloud service account with proper scopes (scopes are handled by [goauth](https://crates.io/crates/goauth), as part of authentication), \n\n### Usage\n\n*In your Cargo.toml*\n\n```\n[dependencies]\nbigtable = '0.3'\n```\n\n#### Higher level wrappers (`wraps`)\n\nThere and higher wrappers available for reading and writing rows, so there is not need to craft `protobufs` manually. Write can also be used to update, but not very robustly yet, coming soon :).\n\n##### Read and Write\n\nRead wrappers allows for simple limit on the number of rows, it uses the `ReadRows` underlying method.\n\nThere are two write strategies available, `bulk_write_rows` and `write_rows`. `bulk_write_rows` first collects all writes and fires only one request, underlying method is `MutateRows`, this results in a much higher write throughput. `write_rows` shoots one request per row to be written, underlying method is `ReadModifyWriteRow`. \n\n```rust\n\nextern crate bigtable as bt;\n\nuse bt::utils::*;\nuse bt::wraps;\n\nconst TOKEN_URL: \u0026'static str = \"https://www.googleapis.com/oauth2/v4/token\";\nconst ISS: \u0026'static str = \"some-service-account@developer.gserviceaccount.com\";\nconst PK: \u0026'static str = \"pk_for_the_acc_above.pem\";\n\nfn read_rows(limit: i64) -\u003e Result\u003c(serde_json::Value), BTErr\u003e {\n\n    let token = get_auth_token(TOKEN_URL, ISS, PK)?;\n    let table = Default::default();\n\n    wraps::read_rows(table, \u0026token, Some(limit))\n\n}\n\nfn write_rows(n: usize, bulk: bool) -\u003e Result\u003c(), BTErr\u003e {\n    let mut rows: Vec\u003cwraps::Row\u003e = vec!(wraps::Row::default()); // put some real data here\n    let token = get_auth_token(TOKEN_URL, ISS, PK)?;\n    let table = Default::default(); // Again use a real table here\n    if bulk {\n        let _ = wraps::bulk_write_rows(\u0026mut rows, \u0026token, table);\n    } else {\n        let _ = wraps::write_rows(\u0026mut rows, \u0026token, table);\n    }\n    Ok(())\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdurch%2Frust-bigtable","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdurch%2Frust-bigtable","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdurch%2Frust-bigtable/lists"}