True async query execution
@sumitmsft がすでに取り組んでいます。
2025年3月3日 から。
評価
この issue はまだ評価されていません。
説明
Is your feature request related to a problem? Please describe.
Currently, mssql-python does not support true async execution, forcing developers to use thread-based workarounds (asyncio.to_thread() or aioodbc). This leads to performance limitations, increased memory usage, and suboptimal scalability in high-throughput applications, such as web servers and data processing pipelines.
For applications using FastAPI, Django Async, or AI/ML workloads, true async support is critical for handling multiple concurrent database operations efficiently. Without it, developers face blocking I/O that slows down event-driven applications.
Describe the solution you'd like
- Truly non-blocking I/O using
asyncio(asyncio.StreamReader/asyncio.StreamWriter). - Async query execution with
await conn.execute("SELECT ..."). - Streaming large result sets asynchronously using
async for row in cursor. - Better scalability for FastAPI, Django Async, and other async frameworks.
Example API:
async def stream_users():
conn = await asyncpg.connect(...)
async with conn.transaction(): # Ensures rollback on failure
async for row in conn.cursor("SELECT * FROM users"):
print(row) # Process each row asynchronously
await conn.close()
asyncio.run(stream_users())
### Describe alternatives you've considered
- asyncio.to_thread() → Still uses blocking I/O and threads, increasing overhead.
- aioodbc → Uses a thread pool, not true async, leading to performance bottlenecks.
- Custom Thread Management → Adds complexity and does not scale well under high concurrency.
### Additional context
- 主要言語
- Python
- スター
- 473
- フォーク
- 60
- 平均マージ
- 2日 11時間
- マージ済み PR(30日)
- 36
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
microsoft/mssql-python のほかの issue
-
area: bulk-copy bug triage done
microsoft/mssql-python#750 · コメント 4 件 · 担当者 1 名 ·
-
announcement
microsoft/mssql-python#748 · 担当者 1 名 ·
-
area: connectivity-auth bug triage needed
難易度 4/5 3〜5日 初心者へのやさしさ 62/100
microsoft/mssql-python#746 · コメント 1 件 ·
-
area: data-types bug triage done
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
microsoft/mssql-python#745 · コメント 1 件 ·
-
area: packaging-platform bug dependency: external triage done
microsoft/mssql-python#685 · コメント 2 件 · 担当者 1 名 ·
microsoft/mssql-python の issue をすべて見る
似ている issue
-
link-check link-check:sphinx-theme
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
qgis/QGIS-Documentation#11275 ·
-
bug priority:normal ready-for-dev
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
OpenHands/extensions#626 · コメント 1 件 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
CSCfi/sd-search-api#39 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 90/100