Reputation: 2158
I am trying to find complete documentation for cursor.fetchone and all I can find is: http://mysql-python.sourceforge.net/MySQLdb-1.2.2/public/MySQLdb.cursors.CursorStoreResultMixIn-class.html#fetchone
my questions are: what is exactly returned? a normal python array? what does it return if there no more rows? what does it do if the connection is dropped? throw an error? have a unique return value? I am not sure why I can't find real documentation on this. Thank you in advance
Upvotes: 0
Views: 214
Reputation: 1087
I'll try to answer in order your questions.
What is exactly returned?
A tuple or a dictionary, depending how you did the connection.
What does it return if there no more rows?
None
What does it do if the connection is dropped?
An Exception is raised. If it's due to a timeout, for instance, it will be a MySQLdb.OperationalError
.
I am not sure why I can't find real documentation on this
Try here: https://mysqlclient.readthedocs.io/
Upvotes: 1