Skip to content

Commit

Permalink
update sqlalchemy example
Browse files Browse the repository at this point in the history
  • Loading branch information
livioribeiro committed Apr 17, 2024
1 parent 4272b0c commit 5dc19c5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions examples/sqlalchemy/application/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class DefautDBService:
sessionmaker: Annotated[async_sessionmaker, Inject]

async def initialize(self):
async with self.engine.begin() as conn:
async with self.engine.connect() as conn:
await conn.run_sync(Base.metadata.create_all)

async with self.sessionmaker() as session:
Expand All @@ -37,7 +37,7 @@ class OtherDBService:
sessionmaker: Annotated[async_sessionmaker, Inject]

async def initialize(self):
async with self.engine.begin() as conn:
async with self.engine.connect() as conn:
await conn.run_sync(OtherBase.metadata.create_all)

async with self.sessionmaker() as session:
Expand Down

0 comments on commit 5dc19c5

Please sign in to comment.