bloomberg / bloomberg/python-comdb2
Provide a "class" row factory
未关闭
- 主要语言
- Python
- 星标
- 29
- 派生
- 28
- 平均合并
- 11 小时 25 分钟
- 30 天内合并 PR
- 2
描述
**Is your feature request related to a problem? Please describe.**
Currently, comdb2 module provides dict and namedtuple factories. It would also be nice to provide a "class" row factory which would allow rows returned as client-defined dataclasses, pydantic models, etc.
**Describe the solution you'd like**
See a similar concept in psycopg's `class_row` factory: https://www.psycopg.org/psycopg3/docs/api/rows.html#psycopg.rows.class_row
This also allows nice static type checking: https://www.psycopg.org/psycopg3/docs/advanced/typing.html#example-returning-records-as-pydantic-models
贡献指南
评估
这个 Issue 还没有评估数据。