{"id":29902059,"url":"https://github.com/fboulnois/nanopool","last_synced_at":"2026-03-16T11:37:04.696Z","repository":{"id":305691522,"uuid":"1005015458","full_name":"fboulnois/nanopool","owner":"fboulnois","description":"A tiny database connection pooling library for PostgreSQL","archived":false,"fork":false,"pushed_at":"2025-06-19T14:30:16.000Z","size":33,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-21T14:57:13.999Z","etag":null,"topics":["async","postgres","postgresql","rust","sql","tokio","tokio-postgres"],"latest_commit_sha":null,"homepage":"","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/fboulnois.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-06-19T14:28:39.000Z","updated_at":"2025-06-19T14:34:18.000Z","dependencies_parsed_at":"2025-07-21T14:57:19.134Z","dependency_job_id":"4efe064c-3274-4d64-bb67-80448b498293","html_url":"https://github.com/fboulnois/nanopool","commit_stats":null,"previous_names":["fboulnois/nanopool"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/fboulnois/nanopool","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fboulnois%2Fnanopool","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fboulnois%2Fnanopool/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fboulnois%2Fnanopool/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fboulnois%2Fnanopool/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fboulnois","download_url":"https://codeload.github.com/fboulnois/nanopool/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fboulnois%2Fnanopool/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268255547,"owners_count":24221030,"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","status":"online","status_checked_at":"2025-08-01T02:00:08.611Z","response_time":67,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["async","postgres","postgresql","rust","sql","tokio","tokio-postgres"],"created_at":"2025-08-01T15:49:41.178Z","updated_at":"2025-12-26T21:30:46.255Z","avatar_url":"https://github.com/fboulnois.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# nanopool\n\nA fast and tiny asynchronous database pool for PostgreSQL.\n\nThe pool is built on top of the Tokio ecosystem to minimize non-Tokio dependencies and maximize performance. It also aims to be easy to use, with a simple API and minimal configuration. The pool has built-in TLS support, and optional features like `uuid` can be enabled for additional PostgreSQL functionality. It purposely does not support other databases to keep the codebase small and focused.\n\nThe pool is backed by a Tokio `mpsc` channel, which is optimized for fast concurrent access. Database operations are executed using `tokio-postgres`, which is a high-performance asynchronous PostgreSQL driver. Secure connections to PostgreSQL are supported through the `tokio-native-tls` crate. The core pool implementation is \u003c200 lines of code, making it lightweight and easy to understand.\n\n## Usage\n\n1. Add `nanopool` to your `Cargo.toml`:\n\n```toml\n[dependencies]\nnanopool = \"1.0\"\n```\n\n2. Create and use a connection pool:\n\n```rust\nuse nanopool::{Pool, tls};\n\n// create the pool with TLS support\nlet tls = tls::configure(tls::TlsMode::Require).unwrap();\nlet pool_size = 4;\nlet pool = Pool::new(\"postgresql://postgres:postgres@localhost/postgres\", tls, pool_size).await.unwrap();\n\n// or without TLS support\n// let pool = Pool::new(\"postgresql://postgres:postgres@localhost/postgres\", tls::NoTls, pool_size).await.unwrap();\n\n// returns a `tokio_postgres::Client` instance\nlet client = pool.client().await.unwrap();\n\n// execute a query\nlet row = client.query_one(\"SELECT 1 + 2\", \u0026[]).await.unwrap();\nlet sum: i32 = row.get(0);\n\n// the client is automatically returned to the pool when dropped\n```\n\n## Optional features\n\n- `uuid`: Enables support for UUIDs so they can be used in and returned from queries. This feature depends on the `uuid` crate. These can then be used from your code with `nanopool::uuid::Uuid`.\n\n## Development\n\n### Building\n\nTo build the library:\n\n```sh\ncargo build\n```\n\n### Testing\n\nTo run unit tests:\n\n```sh\ncargo test\n```\n\nTo also run integration tests against a PostgreSQL database:\n\n```sh\ndocker compose -f tests/docker-compose.test.yml up -d\ncargo test -- --include-ignored\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffboulnois%2Fnanopool","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffboulnois%2Fnanopool","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffboulnois%2Fnanopool/lists"}