bloomberg / bloomberg/python-comdb2

Provide a "class" row factory

Open
#42 14 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
29
Forks
28
Avg merge
11h 25m
Merged PRs (30d)
2

Description

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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.