oracle / python-oracledb

Python driver for Oracle Database conforming to the Python DB API 2.0 specification. This is the renamed, new major release of cx_Oracle
https://oracle.github.io/python-oracledb
Other
307 stars 59 forks source link

Implement a Record object #302

Open anthony-tuininga opened 4 months ago

anthony-tuininga commented 4 months ago

Discussed in https://github.com/oracle/python-oracledb/discussions/301

Originally posted by **syniex** February 27, 2024 Currently, when retrieving results from a database, many of us construct dictionaries from lists of tuples to provide a more convenient API for working with the data. This approach is common but might not be the most efficient. We could create a Record class in Cython that encapsulates the data returned from the database. This class would allow for easier access to column values and could potentially offer performance benefits over the current approach of using dictionaries. [asyncpg Record API Documentation](https://magicstack.github.io/asyncpg/current/api/index.html#record-objects)
syniex commented 3 months ago

@anthony-tuininga what are your thoughts about this?

anthony-tuininga commented 3 months ago

I am still thinking about it. I need some time to determine how much of a performance hit this would incur. Assuming that is too much of a hit I have some other thoughts on how to allow for an easy opt-in for those who want it -- but I need some time to do some research on these matters. I haven't forgotten about it, though!