Skip to content
This repository has been archived by the owner on Mar 24, 2024. It is now read-only.

Commit

Permalink
release
Browse files Browse the repository at this point in the history
  • Loading branch information
lsbardel committed Oct 15, 2022
1 parent 933844a commit 5774255
Show file tree
Hide file tree
Showing 5 changed files with 500 additions and 461 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ lint: ## run linters


mypy: ## run mypy
@mypy openapi
@poetry run mypy openapi


outdated: ## Show outdated packages
Expand Down
2 changes: 1 addition & 1 deletion openapi/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
"""Minimal OpenAPI asynchronous server application"""
__version__ = "3.0.2"
__version__ = "3.0.3"
5 changes: 4 additions & 1 deletion openapi/db/container.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ async def transaction(self) -> Connection:
yield conn

@asynccontextmanager
async def ensure_connection(self, conn: Optional[Connection] = None) -> Connection:
async def ensure_transaction(self, conn: Optional[Connection] = None) -> Connection:
"""Context manager for ensuring we a connection has initialized
a database transaction"""
if conn:
Expand All @@ -100,6 +100,9 @@ async def ensure_connection(self, conn: Optional[Connection] = None) -> Connecti
async with self.transaction() as conn:
yield conn

# backward compatibility
ensure_connection = ensure_transaction

async def close(self) -> None:
"""Close the asynchronous db engine if opened"""
if self._engine:
Expand Down

0 comments on commit 5774255

Please sign in to comment.