microsoft / microsoft/mssql-python

Add .to_dict to Row objects

Offen
#606 4 Kommentare 0 Reaktionen 1 zugewiesene Person Auf GitHub ansehen

@jahnvi480 arbeitet bereits daran.

Seit 01.6.2026.

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

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.