@mytec: 1.1iter ready for testing

This commit is contained in:
2026-01-30 22:36:32 +02:00
parent 43b1267c56
commit 4326a6c4f7
28 changed files with 245 additions and 8 deletions

View File

@@ -0,0 +1,22 @@
from motor.motor_asyncio import AsyncIOMotorClient
from app.core.config import settings
class Database:
client: AsyncIOMotorClient = None
db = Database()
async def get_database():
return db.client[settings.DATABASE_NAME]
async def connect_to_mongo():
db.client = AsyncIOMotorClient(settings.MONGODB_URL)
async def close_mongo_connection():
if db.client:
db.client.close()