microsoft / microsoft/mssql-python
Add .to_dict to Row objects
@jahnvi480 arbeitet bereits daran.
Seit 01.6.2026.
- Vorherrschende Sprache
- Python
- Sterne
- 472
- Forks
- 60
- Ø Merge
- 2 T. 11 Std.
- Gemergte PRs (30 T.)
- 36
Beschreibung
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!
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Bewertung
Dieses Issue wurde noch nicht bewertet.