{"id":27990663,"url":"https://github.com/ariaandika/postro","last_synced_at":"2026-05-07T08:35:22.489Z","repository":{"id":283907075,"uuid":"953053569","full_name":"ariaandika/postro","owner":"ariaandika","description":"Asynchronous Postgres Driver and Utility.","archived":false,"fork":false,"pushed_at":"2025-05-04T09:05:24.000Z","size":549,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-04T10:20:10.756Z","etag":null,"topics":["database","postgres","sql"],"latest_commit_sha":null,"homepage":"https://docs.rs/postro","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/ariaandika.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-03-22T13:14:55.000Z","updated_at":"2025-05-04T09:27:52.000Z","dependencies_parsed_at":null,"dependency_job_id":"40a740fa-f4c9-43a3-8182-eac9fe37b586","html_url":"https://github.com/ariaandika/postro","commit_stats":null,"previous_names":["ariaandika/qscv","ariaandika/postro"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ariaandika%2Fpostro","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ariaandika%2Fpostro/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ariaandika%2Fpostro/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ariaandika%2Fpostro/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ariaandika","download_url":"https://codeload.github.com/ariaandika/postro/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252504240,"owners_count":21758661,"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","postgres","sql"],"created_at":"2025-05-08T16:49:39.146Z","updated_at":"2026-05-07T08:35:22.442Z","avatar_url":"https://github.com/ariaandika.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Postro Postgres Driver\n\nAn Async PostgreSQL Driver and Tools, designed with an API similar to\n[sqlx](https://github.com/launchbadge/sqlx), and smaller dependency tree.\n\n## Installation\n\nTo install `postro`, run:\n\n```bash\ncargo add postro\n```\n\nor add this line to your `Cargo.toml` in `[dependencies]` section:\n\n```toml\npostro = \"0.1.1\"\n```\n\n## Usage\n\nThe general usage is to use database pooling via the `Pool` API:\n\n```rust\nuse postro::{FromRow, Pool, Result, execute, query};\n\n// automatically extract query result\n#[derive(Debug, FromRow)]\nstruct Post {\n    id: i32,\n    name: String,\n}\n\n#[tokio::main]\nasync fn main() -\u003e Result\u003c()\u003e {\n    // will read the `DATABASE_URL` environment variable\n    let mut pool = Pool::connect_env().await?;\n    let mut handles = vec![];\n\n    // execute a statement\n    execute(\"CREATE TABLE post(id serial, name text)\", \u0026mut pool).await?;\n\n    for i in 0..24 {\n        // cloning pool is cheap and share the same connection pool\n        let mut pool = pool.clone();\n\n        handles.push(tokio::spawn(async move {\n            execute(\"INSERT INTO post(name) VALUES($1)\", \u0026mut pool)\n                .bind(\u0026format!(\"thread{i}\"))\n                .await\n        }));\n    }\n\n    for h in handles {\n        h.await.unwrap()?;\n    }\n\n    // extract query result\n    let posts = query::\u003c_, _, Post\u003e(\"SELECT * FROM post\", \u0026mut pool)\n        .fetch_all()\n        .await?;\n\n    assert!(posts.iter().any(|e| e.name.as_str() == \"thread23\"));\n    assert_eq!(posts.len(), 24);\n\n    Ok(())\n}\n```\n\nsee the documentation for [more details](https://docs.rs/postro)\n\n## License\nThis project is licensed under the **MIT License** - see the [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fariaandika%2Fpostro","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fariaandika%2Fpostro","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fariaandika%2Fpostro/lists"}