Current implementation has different class for each Row/Record/RowProxy.
Any chance a common interface can be used / monkey patched into each of these so they behave more similarly.
Something as simple as:
fromtypingimportMappingrow=awaitdatabase.fetch_one(query)
isinstance(row, Mapping)
# returns True for Postgres but False for SQLite
Also the __str__ and __repr__ have a vastly different look.
The postgres Record class has neither a __str__ nor a __repr__ (PR for __str__ done that returns what looks like a standard python dict / Mapping)
But when you get a RowProxy from sqlite it looks like a tuple. This is surprising because RowProxy has item(), keys(), values(). Shouldn't it look more like a mapping in __str__?
I haven't investigated mysql yet.
The text was updated successfully, but these errors were encountered:
Current implementation has different class for each Row/Record/RowProxy.
Any chance a common interface can be used / monkey patched into each of these so they behave more similarly.
Something as simple as:
Also the
__str__and__repr__have a vastly different look.The postgres
Recordclass has neither a__str__nor a__repr__(PR for__str__done that returns what looks like a standard python dict / Mapping)But when you get a RowProxy from sqlite it looks like a tuple. This is surprising because
RowProxyhasitem(),keys(),values(). Shouldn't it look more like a mapping in__str__?I haven't investigated mysql yet.
The text was updated successfully, but these errors were encountered: