{"id":20173103,"url":"https://github.com/ohmycloud/fastapi_db_pool","last_synced_at":"2025-03-03T04:41:35.676Z","repository":{"id":223097235,"uuid":"745362837","full_name":"ohmycloud/fastapi_db_pool","owner":"ohmycloud","description":"FastAPI 数据库连接池(Example)","archived":false,"fork":false,"pushed_at":"2024-01-22T07:37:07.000Z","size":8,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-24T16:14:25.941Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ohmycloud.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2024-01-19T07:06:44.000Z","updated_at":"2024-02-18T07:27:24.000Z","dependencies_parsed_at":"2024-02-18T09:26:56.319Z","dependency_job_id":"6dc4fb32-9fa6-417c-9e34-be61bee4d718","html_url":"https://github.com/ohmycloud/fastapi_db_pool","commit_stats":null,"previous_names":["ohmycloud/fastapi_db_pool"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ohmycloud%2Ffastapi_db_pool","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ohmycloud%2Ffastapi_db_pool/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ohmycloud%2Ffastapi_db_pool/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ohmycloud%2Ffastapi_db_pool/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ohmycloud","download_url":"https://codeload.github.com/ohmycloud/fastapi_db_pool/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241610976,"owners_count":19990505,"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":[],"created_at":"2024-11-14T01:33:26.091Z","updated_at":"2025-03-03T04:41:35.647Z","avatar_url":"https://github.com/ohmycloud.png","language":"Python","readme":"# Fast-API with DB Connection Pools\n\n## Problem Statement\n\n### Some common problems with database connections\n1. Database connection limit exceeded\n2. Database connection timeout\n3. Database connection is not closed properly\n4. Database connection is not released properly\n\n创建一个 Postgres 数据库表, 包含 `id`, `fname`, `lname`, `email`, `password` 这些字段：\n\n```sql\nCREATE TABLE public.user\n(\n    id serial PRIMARY KEY,\n    fname VARCHAR(50) NOT NULL,\n    lname VARCHAR(50) NOT NULL,\n    email VARCHAR(50) NOT NULL,\n    password VARCHAR(50) NOT NULL\n);\n```\n\n连接池的创建参考：https://github.com/tiangolo/fastapi/discussions/9097\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fohmycloud%2Ffastapi_db_pool","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fohmycloud%2Ffastapi_db_pool","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fohmycloud%2Ffastapi_db_pool/lists"}