microsoft / microsoft/mssql-python
Add .to_dict to Row objects
@jahnvi480 is already working on this.
Since Jun 1, 2026.
- Dominant language
- Python
- Stars
- 472
- Forks
- 60
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 36
Description
Is your feature request related to a problem? Please describe.
I've just finished testing the newly released row-string indexing feature. It's great and extremely handy for cases where a mapping interface is needed. However, I think it can go a bit further: Sometimes we need to pass a true dict into some legacy thing, and here mssql-python could help, by providing a built-in to_dict() function.
Describe the solution you'd like
I would like a function on the Row object that will return a Python dict with all of the row's values.
Describe alternatives you've considered
Interrogating the cursor's description property and producing my own dict is easy enough. But it would certainly be a lot easier, and probably faster, to let mssql-python do the work instead.
Thank you!
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.