Vous êtes un professionnel et vous avez besoin d'une formation ?
Sensibilisation àl'Intelligence Artificielle
Voir le programme détaillé
Module « sqlalchemy »
Classe « Uuid »
Informations générales
Héritage
builtins.object
Generic
builtins.object
Visitable
TypeEngine
builtins.object
TypeEngineMixin
Emulated
Uuid
Définition
class Uuid(Emulated, TypeEngine):
help(Uuid)
Represent a database agnostic UUID datatype.
For backends that have no "native" UUID datatype, the value will
make use of ``CHAR(32)`` and store the UUID as a 32-character alphanumeric
hex string.
For backends which are known to support ``UUID`` directly or a similar
uuid-storing datatype such as SQL Server's ``UNIQUEIDENTIFIER``, a
"native" mode enabled by default allows these types will be used on those
backends.
In its default mode of use, the :class:`_sqltypes.Uuid` datatype expects
**Python uuid objects**, from the Python
`uuid <https://docs.python.org/3/library/uuid.html>`_
module::
import uuid
from sqlalchemy import Uuid
from sqlalchemy import Table, Column, MetaData, String
metadata_obj = MetaData()
t = Table(
"t",
metadata_obj,
Column("uuid_data", Uuid, primary_key=True),
Column("other_data", String),
)
with engine.begin() as conn:
conn.execute(
t.insert(), {"uuid_data": uuid.uuid4(), "other_data": "some data"}
)
To have the :class:`_sqltypes.Uuid` datatype work with string-based
Uuids (e.g. 32 character hexadecimal strings), pass the
:paramref:`_sqltypes.Uuid.as_uuid` parameter with the value ``False``.
.. versionadded:: 2.0
.. seealso::
:class:`_sqltypes.UUID` - represents exactly the ``UUID`` datatype
without any backend-agnostic behaviors.
Constructeur(s)
Liste des attributs statiques
collation | None |
hashable | True |
render_bind_cast | False |
render_literal_cast | False |
should_evaluate_none | False |
sort_key_function | None |
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
Méthodes héritées de la classe TypeEngine
__repr__, __str__, __subclasshook__, adapt, as_generic, bind_expression, column_expression, Comparator, comparator_factory, compare_values, compile, copy, copy_value, dialect_impl, evaluates_none, get_dbapi_type, with_variant
Méthodes héritées de la classe Generic
__class_getitem__,
__init_subclass__
Méthodes héritées de la classe Visitable
__class_getitem__, __init_subclass__
Méthodes héritées de la classe Emulated
adapt_to_emulated
Méthodes héritées de la classe object
__delattr__,
__dir__,
__format__,
__getattribute__,
__getstate__,
__hash__,
__reduce__,
__reduce_ex__,
__setattr__,
__sizeof__
Vous êtes un professionnel et vous avez besoin d'une formation ?
Deep Learning avec Python
et Keras et Tensorflow
Voir le programme détaillé
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 :