You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Would it make more sense to return self from cursor.execute instead of TrinoResult
This would allow you to chain fetch operations
value=cursor.execute('SELECT 1').fetchone()[0]
In addition, __iter__ and rowcount can be implemented on the cursor itself - this seems to be how it is commonly done.
So with return self and __iter__ implemented the following would still be possible for convenience:
forrowincursor.execute('select * from system.runtime.nodes'):
print(row)
This is the behavior of psycopg3
The Python DBAPI2 spec doesn't specify the return value of execute so it's up to the driver to decide, but it is common in quite a few Python DBAPI2 drivers.
Describe alternatives you've considered
No response
Are you willing to submit PR?
Yes I am willing to submit a PR!
The text was updated successfully, but these errors were encountered:
Describe the feature
Would it make more sense to return
self
fromcursor.execute
instead ofTrinoResult
This would allow you to chain fetch operations
In addition,
__iter__
androwcount
can be implemented on the cursor itself - this seems to be how it is commonly done.So with
return self
and__iter__
implemented the following would still be possible for convenience:This is the behavior of psycopg3
The Python DBAPI2 spec doesn't specify the return value of
execute
so it's up to the driver to decide, but it is common in quite a few Python DBAPI2 drivers.Describe alternatives you've considered
No response
Are you willing to submit PR?
The text was updated successfully, but these errors were encountered: