Skip to content

Commit

Permalink
Merge pull request #101 from levinotik/patch-1
Browse files Browse the repository at this point in the history
Update to use async_sessionmaker
  • Loading branch information
grillazz authored Aug 2, 2023
2 parents 9622a47 + 4c8d783 commit 2c1d006
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/database.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from collections.abc import AsyncGenerator

from sqlalchemy.ext.asyncio import AsyncSession, create_async_engine
from sqlalchemy.orm import sessionmaker
from sqlalchemy.ext.asyncio import async_sessionmaker

from app import config
from app.utils.logging import AppLogger
Expand All @@ -17,7 +17,7 @@

# expire_on_commit=False will prevent attributes from being expired
# after commit.
AsyncSessionFactory = sessionmaker(engine, autoflush=False, expire_on_commit=False, class_=AsyncSession)
AsyncSessionFactory = async_sessionmaker(engine, autoflush=False, expire_on_commit=False,)


# Dependency
Expand Down

0 comments on commit 2c1d006

Please sign in to comment.