Skip to content

Commit

Permalink
add asyncpg
Browse files Browse the repository at this point in the history
  • Loading branch information
BinamB committed May 24, 2024
1 parent 253cfe4 commit b28594f
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 2 deletions.
2 changes: 1 addition & 1 deletion bin/migrate_with_asyncio.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def __init__(self, conf_data=None):
self.n_workers = self.thread_pool_size + self.concurrency

self.engine = create_async_engine(
f"postgresql+psycopg2://{usr}:{psw}@{pghost}:{pgport}/{db}", echo=True
f"postgresql+asyncpg://{usr}:{psw}@{pghost}:{pgport}/{db}", echo=True
)
self.async_session = sessionmaker(
self.engine, expire_on_commit=False, class_=AsyncSession
Expand Down
70 changes: 69 additions & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ psycopg2 = "^2.7"
sqlalchemy = "^1.4.0"
sqlalchemy-utils = "^0.37.3"
PyYAML = "^5.4"
asyncpg = "^0.29.0"


[tool.poetry.dev-dependencies]
Expand Down

0 comments on commit b28594f

Please sign in to comment.