bloomberg / bloomberg/python-comdb2

Provide a "class" row factory

Đang mở
#42 14 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Python
Star
29
Fork
28
Merge trung bình
11 giờ 25 phút
Pull request đã merge (30 ngày)
2

Mô tả

**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

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.