Participer au site avec un Tip
Rechercher
 

Améliorations / Corrections

Vous avez des améliorations (ou des corrections) à proposer pour ce document : je vous remerçie par avance de m'en faire part, cela m'aide à améliorer le site.

Emplacement :

Description des améliorations :

Vous êtes un professionnel et vous avez besoin d'une formation ? RAG (Retrieval-Augmented Generation)
et Fine Tuning d'un LLM
Voir le programme détaillé
Classe « Connection »

Méthode mariadb.Connection.cursor

Signature de la méthode cursor

def cursor(self, cursorclass=<class 'mariadb.cursors.Cursor'>, **kwargs) 

Description

help(Connection.cursor)

Returns a new cursor object for the current connection.

If no cursorclass was specified, a cursor with default mariadb.Cursor
class will be created.

Optional keyword parameters:

- buffered = True
  If set to False the result will be unbuffered, which means before
  executing another statement with the same connection the entire
  result set must be fetched.
  Please note that the default was False for MariaDB Connector/Python
  versions < 1.1.0.

- dictionary = False
  Return fetch values as dictionary.

- named_tuple = False
  Return fetch values as named tuple. This feature exists for
  compatibility reasons and should be avoided due to possible
  inconsistency.

- cursor_type = CURSOR.NONE
  If cursor_type is set to CURSOR.READ_ONLY, a cursor is opened
  for the statement invoked with cursors execute() method.

- prepared = False
  When set to True cursor will remain in prepared state after the first
  execute() method was called. Further calls to execute() method will
  ignore the sql statement.

- binary = False
  Always execute statement in MariaDB client/server binary protocol.

In versions prior to 1.1.0 results were unbuffered by default,
which means before executing another statement with the same
connection the entire result set must be fetched.

fetch* methods of the cursor class by default return result set values
as a tuple, unless named_tuple or dictionary was specified.
The latter one exists for compatibility reasons and should be avoided
due to possible inconsistency in case two or more fields in a result
set have the same name.

If cursor_type is set to CURSOR.READ_ONLY, a cursor is opened for
the statement invoked with cursors execute() method.


Vous êtes un professionnel et vous avez besoin d'une formation ? Programmation Python
Les fondamentaux
Voir le programme détaillé