{"id":13468166,"url":"https://github.com/DavidBM/qldb-rs","last_synced_at":"2025-03-26T05:30:56.388Z","repository":{"id":42645963,"uuid":"310260635","full_name":"DavidBM/qldb-rs","owner":"DavidBM","description":"Pure Rust driver for Amazon's QLDB ledger","archived":false,"fork":false,"pushed_at":"2024-08-13T19:15:16.000Z","size":246,"stargazers_count":4,"open_issues_count":0,"forks_count":4,"subscribers_count":5,"default_branch":"main","last_synced_at":"2024-10-29T22:55:47.027Z","etag":null,"topics":["database","driver","pure-rust","qldb","rust"],"latest_commit_sha":null,"homepage":null,"language":"Rust","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/DavidBM.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":["DavidBM"]}},"created_at":"2020-11-05T10:13:44.000Z","updated_at":"2024-08-13T19:15:20.000Z","dependencies_parsed_at":"2024-01-16T07:07:25.232Z","dependency_job_id":null,"html_url":"https://github.com/DavidBM/qldb-rs","commit_stats":null,"previous_names":["couragium/qldb-rs"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DavidBM%2Fqldb-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DavidBM%2Fqldb-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DavidBM%2Fqldb-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DavidBM%2Fqldb-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DavidBM","download_url":"https://codeload.github.com/DavidBM/qldb-rs/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245597195,"owners_count":20641859,"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":["database","driver","pure-rust","qldb","rust"],"created_at":"2024-07-31T15:01:06.489Z","updated_at":"2025-03-26T05:30:55.900Z","avatar_url":"https://github.com/DavidBM.png","language":"Rust","funding_links":["https://github.com/sponsors/DavidBM"],"categories":["Libraries"],"sub_categories":["Database"],"readme":"\u003c!-- cargo-sync-readme start --\u003e\n\n# Amazon's QLDB Driver\n\nDriver for Amazon's QLDB Database implemented in pure rust.\n\n[![Documentation](https://docs.rs/qldb/badge.svg)](https://docs.rs/qldb)\n[![Crates.io](https://img.shields.io/crates/v/qldb)](https://crates.io/crates/qldb)\n[![Rust](https://github.com/Couragium/qldb-rs/actions/workflows/rust.yml/badge.svg)](https://github.com/Couragium/qldb-rs/actions/workflows/rust.yml)\n\nThe driver is fairly tested and should be ready to test in real projects.\n\n## Example\n\n```rust,no_run\nuse qldb::QldbClient;\nuse std::collections::HashMap;\n\nlet client = QldbClient::default(\"rust-crate-test\", 200).await?;\n\nlet mut value_to_insert = HashMap::new();\n// This will insert a documents with a key \"test_column\"\n// with the value \"IonValue::String(test_value)\"\nvalue_to_insert.insert(\"test_column\", \"test_value\");\n\nclient\n    .transaction_within(|client| async move {   \n        client\n            .query(\"INSERT INTO TestTable VALUE ?\")\n            .param(value_to_insert)\n            .execute()\n            .await?;\n        Ok(())\n    })\n    .await?;\n```\n\n# Session Pool\n\nThe driver has a session pool. The second parameter in the\nQldbClient::default is the maximum size of the connection pool.\n\nThe pool will be auto-populated as parallel transaction are being\nrequested until it reaches the provided maximum.\n\nThe pool uses one independent thread with a single-threaded \nexecutor ([async-executor](https://crates.io/crates/async-executor)) \nin order to be able to spawn tasks after the session has been returned.\n\n## Alternative session Pool\n\nThere is an alternative session pool that will require an spawner \nfunction to be provided. It allows to have the pool running by using\nthe spawn function of the executor you use. We tested async-std and \ntokio, but others should work as well.\n\nThis pool will spawn two internal tasks handling the pool.\n\nUse this if you want for this driver to not create a new thread.\n\nExample with async-std:\n\n```rust,no_run\n    let client = QldbClient::default_with_spawner(\n        \"rust-crate-test\", \n        200, \n        Arc::new(move |fut| {async_std::task::spawn(Box::pin(fut));})\n    )\n    .await?\n```\n\nOr, with tokio:\n\n```rust,no_run\n    let client = QldbClient::default_with_spawner(\n        \"rust-crate-test\", \n        200, \n        Arc::new(move |fut| {tokio::spawn(Box::pin(fut));})\n    )\n    .await?\n```\n\n## Select the pool you want to use\n\nBy default, both pools are available by using the methods `QldbClient::default` \nand `QldbClient::default_with_spawner`. If you don't want the pool to be available\nin runtime, you can disable by removing the default features. Still, you will \nneed to add at least one feature to enable one pool.\n\nThis will only enable the default pool, the one that uses one thread.\n```toml,no_code\nqldb = { version = \"3\", default_features = false, features = [\"internal_pool_with_thread\"]}\n```\n\nThis will only enable the alternative pool, the one that requires an spawner\n```toml,no_code\nqldb = { version = \"3\", default_features = false, features = [\"internal_pool_with_spawner\"]}\n```\n\n# Underlying Ion Format Implementation\n\nThe library uses [ion-binary-rs](https://crates.io/crates/ion-binary-rs), \nwhich is our own, pure rust, implementation of the format. It is very \nwell tested and ready to use in production too.\n\n# Test\n\nFor tests you will need to have some AWS credentials in your\nPC (as env variables or in ~/.aws/credentials). There needs\nto be a QLDB database with the name \"rust-crate-test\" in the\naws account. The tests need to be run sequentially, so in order\nto run the tests please run the following command:\n\n```sh\nRUST_TEST_THREADS=1 cargo test\n```\n\n\u003c!-- cargo-sync-readme end --\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FDavidBM%2Fqldb-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FDavidBM%2Fqldb-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FDavidBM%2Fqldb-rs/lists"}