TomMalkin / SimQLe

The simplest way to use SQL in Python
MIT License
30 stars 5 forks source link

Add quality of life options in recordset #22

Closed TomMalkin closed 5 years ago

TomMalkin commented 5 years ago

Such as returning records in a list of dicts format, rather than (data, headers)

TomMalkin commented 5 years ago

2 useful items would be:

TomMalkin commented 5 years ago

I think making almost like a wrapper function called record_dict, that calls recordset as normal, and then quickly changes it into a list of dicts would be pretty easy here, so that a query like:

select id, name from testtable

would return

[{"id": 0, "name": "Jim"}, {"id": 1, "name": "Leonard"}]

Taking slight more memory but extremely easy to iterate over

TomMalkin commented 5 years ago

being worked on in PR #58

TomMalkin commented 5 years ago

closed in #59