{"id":15623169,"url":"https://github.com/djc/bb8","last_synced_at":"2025-05-13T17:08:51.106Z","repository":{"id":35992417,"uuid":"119445270","full_name":"djc/bb8","owner":"djc","description":"Full-featured async (tokio-based) postgres connection pool (like r2d2)","archived":false,"fork":false,"pushed_at":"2025-05-12T09:54:46.000Z","size":292,"stargazers_count":844,"open_issues_count":27,"forks_count":118,"subscribers_count":18,"default_branch":"main","last_synced_at":"2025-05-12T10:10:40.245Z","etag":null,"topics":["asynchronous","database","hacktoberfest","pooling","tokio"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"khuey/bb8","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/djc.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,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":["djc"],"patreon":"dochtman"}},"created_at":"2018-01-29T21:38:04.000Z","updated_at":"2025-05-12T09:53:50.000Z","dependencies_parsed_at":"2024-01-20T16:28:44.755Z","dependency_job_id":"99140316-594d-479e-b533-adbaf0929793","html_url":"https://github.com/djc/bb8","commit_stats":{"total_commits":322,"total_committers":44,"mean_commits":7.318181818181818,"dds":"0.40372670807453415","last_synced_commit":"8368ba1558bafbfc69412805e07830464a06adea"},"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/djc%2Fbb8","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/djc%2Fbb8/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/djc%2Fbb8/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/djc%2Fbb8/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/djc","download_url":"https://codeload.github.com/djc/bb8/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253990468,"owners_count":21995774,"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":["asynchronous","database","hacktoberfest","pooling","tokio"],"created_at":"2024-10-03T09:56:36.758Z","updated_at":"2025-05-13T17:08:51.061Z","avatar_url":"https://github.com/djc.png","language":"Rust","funding_links":["https://github.com/sponsors/djc","https://patreon.com/dochtman"],"categories":["Rust"],"sub_categories":[],"readme":"# bb8\n\n[![Documentation](https://docs.rs/bb8/badge.svg)](https://docs.rs/bb8/)\n[![Crates.io](https://img.shields.io/crates/v/bb8.svg)](https://crates.io/crates/bb8)\n[![Build status](https://github.com/djc/bb8/workflows/CI/badge.svg)](https://github.com/djc/bb8/actions?query=workflow%3ACI)\n[![codecov](https://codecov.io/gh/djc/bb8/branch/main/graph/badge.svg)](https://codecov.io/gh/djc/bb8)\n[![Chat](https://img.shields.io/discord/976380008299917365?logo=discord)](https://discord.gg/E4DuUP83V2)\n[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](./LICENSE)\n\nA full-featured connection pool, designed for asynchronous connections (using\ntokio). Originally based on [r2d2](https://github.com/sfackler/r2d2).\n\nOpening a new database connection every time one is needed is both inefficient\nand can lead to resource exhaustion under high traffic conditions. A connection\npool maintains a set of open connections to a database, handing them out for\nrepeated use.\n\nbb8 is agnostic to the connection type it is managing. Implementors of the\n`ManageConnection` trait provide the database-specific logic to create and\ncheck the health of connections.\n\nA (possibly not exhaustive) list of adapters for different backends:\n\nBackend | Adapter Crate\n------- | -------------\n[tokio-postgres](https://github.com/sfackler/rust-postgres) | [bb8-postgres](https://crates.io/crates/bb8-postgres) (in-tree)\n[redis](https://github.com/mitsuhiko/redis-rs) | [bb8-redis](https://crates.io/crates/bb8-redis) (in-tree)\n[redis_cluster_async](https://crates.io/crates/redis_cluster_async) | [bb8-redis-cluster](https://crates.io/crates/bb8-redis-cluster)\n[rsmq](https://github.com/smrchy/rsmq) | [rsmq_async](https://crates.io/crates/rsmq_async)\n[bolt-client](https://crates.io/crates/bolt-client) | [bb8-bolt](https://crates.io/crates/bb8-bolt)\n[diesel](https://crates.io/crates/diesel) | [diesel_async](https://github.com/weiznich/diesel_async)\n[tiberius](https://crates.io/crates/tiberius) | [bb8-tiberius](https://crates.io/crates/bb8-tiberius)\n[nebula-client](https://crates.io/crates/nebula-client) | [bb8-nebula](https://crates.io/crates/bb8-nebula)\n[memcache-async](https://github.com/vavrusa/memcache-async) | [bb8-memcached](https://crates.io/crates/bb8-memcached)\n[lapin](https://crates.io/crates/lapin) | [bb8-lapin](https://crates.io/crates/bb8-lapin)\n[arangors](https://crates.io/crates/arangors) | [bb8-arangodb](https://crates.io/crates/bb8-arangodb)\n\n## Example\n\nUsing an imaginary \"foodb\" database.\n\n```rust\n#[tokio::main]\nasync fn main() {\n    let manager = bb8_foodb::FooConnectionManager::new(\"localhost:1234\");\n    let pool = bb8::Pool::builder()\n        .max_size(15)\n        .build(manager)\n        .await\n        .unwrap();\n\n    for _ in 0..20 {\n        let pool = pool.clone();\n        tokio::spawn(async move {\n            let conn = pool.get().await.unwrap();\n            // use the connection\n            // it will be returned to the pool when it falls out of scope.\n        });\n    }\n}\n```\n\n## License\n\nLicensed under the MIT license ([LICENSE](LICENSE)).\n\n### Contribution\n\nUnless you explicitly state otherwise, any contribution intentionally submitted\nfor inclusion in the work by you shall be licensed as above, without any\nadditional terms or conditions.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdjc%2Fbb8","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdjc%2Fbb8","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdjc%2Fbb8/lists"}