This commit is contained in:
caramelteawithmint
2026-11-12 20:23:11 +03:00
parent 0ab3a341aa
commit 01d737e076
27 changed files with 1700 additions and 28 deletions
+14
View File
@@ -0,0 +1,14 @@
import asyncpg
from src import config
pool: asyncpg.Pool | None = None
async def init_db():
global pool
pool = await asyncpg.create_pool(dsn=config.DATABASE_URL, min_size=2, max_size=10)
async def close_db():
global pool
if pool:
await pool.close()
pool = None