{"id":57568,"library":"tokio-postgres","title":"Tokio Postgres","description":"A native, asynchronous PostgreSQL client","status":"active","version":"0.7.18","language":"rust","source_language":null,"source_url":"https://github.com/rust-postgres/rust-postgres","tags":["postgresql","database","async","tokio"],"install":[{"cmd":"# Cargo.toml\n[dependencies]\ntokio-postgres = \"0.7.18\"","lang":"toml","label":"Cargo.toml"},{"cmd":"cargo add tokio-postgres","lang":"bash","label":"cargo add"}],"dependencies":[],"imports":[{"symbol":"Client","correct":"use tokio_postgres::Client;"}],"quickstart":{"code":"use tokio_postgres::Client;\n\n#[tokio::main]\nasync fn main() {\n    let (client, connection) = tokio_postgres::connect(\"host=localhost user=postgres\", tokio_postgres::NoTls).await.unwrap();\n    tokio::spawn(async move { connection.await.unwrap(); });\n    let rows = client.query(\"SELECT 1\", &[]).await.unwrap();\n    println!(\"Query result: {:?}\", rows);\n}","lang":"rust","description":"Connect to a PostgreSQL database and run a query"},"warnings":[{"fix":"Use #[tokio::main] or manually create a Tokio runtime.","message":"Requires a Tokio runtime; will panic if used outside an async context.","severity":"gotcha","affected_versions":">=0.7.0"}],"env_vars":null,"search_vec":"'async':10 'asynchron':5 'client':7 'databas':9 'nativ':4 'postgr':2 'postgresql':6,8 'tokio':1,11","created_at":"2026-06-16T15:48:29.457919+00:00","updated_at":"2026-06-16T15:48:29.457919+00:00","problems":[],"ecosystem":"crates","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/rust-postgres/rust-postgres","github":"https://github.com/rust-postgres/rust-postgres","docs":"https://docs.rs/tokio-postgres/","changelog":null,"pypi":null,"npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["database"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-16","next_check":"2026-12-13","install_tag":null}}