microsoft / microsoft/mssql-python

Add .to_dict to Row objects

Open
#606 4 comments 0 reactions 1 assignee View on GitHub

@jahnvi480 is already working on this.

Since Jun 1, 2026.

area: api-compliance enhancement inADO under development
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.