This commit is contained in:
2026-03-29 06:57:34 -04:00
commit 37503231b3
31 changed files with 3444 additions and 0 deletions

18
app/services/db.py Normal file
View File

@@ -0,0 +1,18 @@
import asyncpg
from app.config import settings
pool: asyncpg.Pool | None = None
async def get_pool() -> asyncpg.Pool:
global pool
if pool is None:
pool = await asyncpg.create_pool(settings.DATABASE_URL, min_size=2, max_size=10)
return pool
async def close_pool():
global pool
if pool:
await pool.close()
pool = None