Initial commit - Migrated to Dev environment
This commit is contained in:
11
backend/app/database.py
Executable file
11
backend/app/database.py
Executable file
@@ -0,0 +1,11 @@
|
||||
from sqlalchemy.ext.asyncio import create_async_engine, AsyncSession, async_sessionmaker
|
||||
from sqlalchemy.orm import DeclarativeBase
|
||||
|
||||
# A .env fájlból olvassuk majd, de teszthez:
|
||||
DATABASE_URL = "postgresql+asyncpg://user:password@db_container_name:5432/db_name"
|
||||
|
||||
engine = create_async_engine(DATABASE_URL, echo=True)
|
||||
SessionLocal = async_sessionmaker(autocommit=False, autoflush=False, bind=engine, class_=AsyncSession)
|
||||
|
||||
class Base(DeclarativeBase):
|
||||
pass
|
||||
Reference in New Issue
Block a user