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é
Module « mysql.connector »

Classe « FieldType »

Informations générales

Héritage

builtins.object
    ABC
        _Constants
            FieldType

Définition

class FieldType(_Constants):

help(FieldType)

MySQL Field Types.

This class provides all supported MySQL field or data types. They can be useful
when dealing with raw data or defining your own converters. The field type is
stored with every cursor in the description for each column.

The `FieldType` class shouldn't be instantiated.

Examples:
    The following example shows how to print the name of the data type for
    each column in a result set.

    ```
    from __future__ import print_function
    import mysql.connector
    from mysql.connector import FieldType

    cnx = mysql.connector.connect(user='scott', database='test')
    cursor = cnx.cursor()

    cursor.execute(
    "SELECT DATE(NOW()) AS `c1`, TIME(NOW()) AS `c2`, "
    "NOW() AS `c3`, 'a string' AS `c4`, 42 AS `c5`")
    rows = cursor.fetchall()

    for desc in cursor.description:
        colname = desc[0]
        coltype = desc[1]
        print("Column {} has type {}".format(
            colname, FieldType.get_info(coltype)))

    cursor.close()
    cnx.close()
    ```

Constructeur(s)

Signature du constructeur Description
__init__(self, /, *args, **kwargs) Initialize self. See help(type(self)) for accurate signature. [extrait de __init__.__doc__]

Liste des attributs statiques

Nom de l'attribut Valeur
BIT16
BLOB252
DATE10
DATETIME12
DECIMAL0
desc{'DECIMAL': (0, 'DECIMAL'), 'TINY': (1, 'TINY'), 'SHORT': (2, 'SHORT'), 'LONG': (3, 'LONG'), 'FLOAT': (4, 'FLOAT'), 'DOUBLE': (5, 'DOUBLE'), 'NULL': (6, 'NULL'), 'TIMESTAMP': (7, 'TIMESTAMP'), 'LONGLONG': (8, 'LONGLONG'), 'INT24': (9, 'INT24'), 'DATE': (10, 'DATE'), 'TIME': (11, 'TIME'), 'DATETIME': (12, 'DATETIME'), 'YEAR': (13, 'YEAR'), 'NEWDATE': (14, 'NEWDATE'), 'VARCHAR': (15, 'VARCHAR'), 'BIT': (16, 'BIT'), 'VECTOR': (242, 'VECTOR'), 'JSON': (245, 'JSON'), 'NEWDECIMAL': (246, 'NEWDECIMAL'), 'ENUM': (247, 'ENUM'), 'SET': (248, 'SET'), 'TINY_BLOB': (249, 'TINY_BLOB'), 'MEDIUM_BLOB': (250, 'MEDIUM_BLOB'), 'LONG_BLOB': (251, 'LONG_BLOB'), 'BLOB': (252, 'BLOB'), 'VAR_STRING': (253, 'VAR_STRING'), 'STRING': (254, 'STRING'), 'GEOMETRY': (255, 'GEOMETRY')}
DOUBLE5
ENUM247
FLOAT4
GEOMETRY255
INT249
JSON245
LONG3
LONG_BLOB251
LONGLONG8
MEDIUM_BLOB250
NEWDATE14
NEWDECIMAL246
NULL6
prefixFIELD_TYPE_
SET248
SHORT2
STRING254
TIME11
TIMESTAMP7
TINY1
TINY_BLOB249
VAR_STRING253
VARCHAR15
VECTOR242
YEAR13

Liste des opérateurs

Opérateurs hérités de la classe object

__eq__, __ge__, __gt__, __le__, __lt__, __ne__

Liste des méthodes

Toutes les méthodes Méthodes d'instance Méthodes statiques Méthodes dépréciées
Signature de la méthodeDescription
get_binary_types() -> List[int] Get the list of all binary types [extrait de get_binary_types.__doc__]
get_number_types() -> List[int] Get the list of all number types [extrait de get_number_types.__doc__]
get_string_types() -> List[int] Get the list of all string types [extrait de get_string_types.__doc__]
get_timestamp_types() -> List[int] Get the list of all timestamp types [extrait de get_timestamp_types.__doc__]

Méthodes héritées de la classe _Constants

__init_subclass__, __subclasshook__, get_desc, get_full_info, get_info

Méthodes héritées de la classe object

__delattr__, __dir__, __format__, __getattribute__, __getstate__, __hash__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__

Vous êtes un professionnel et vous avez besoin d'une formation ? Deep Learning avec Python
et Keras et Tensorflow
Voir le programme détaillé