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 ? Deep Learning avec Python
et Keras et Tensorflow
Voir le programme détaillé
Classe « MetaData »

Constructeur sqlalchemy.MetaData.__init__

Signature de la constructeur __init__

def __init__(self, schema: 'Optional[str]' = None, quote_schema: 'Optional[bool]' = None, naming_convention: 'Optional[_NamingSchemaParameter]' = None, info: 'Optional[_InfoType]' = None) -> 'None' 

Description

help(MetaData.__init__)

Create a new MetaData object.

:param schema:
   The default schema to use for the :class:`_schema.Table`,
   :class:`.Sequence`, and potentially other objects associated with
   this :class:`_schema.MetaData`. Defaults to ``None``.

   .. seealso::

        :ref:`schema_metadata_schema_name` - details on how the
        :paramref:`_schema.MetaData.schema` parameter is used.

        :paramref:`_schema.Table.schema`

        :paramref:`.Sequence.schema`

:param quote_schema:
    Sets the ``quote_schema`` flag for those :class:`_schema.Table`,
    :class:`.Sequence`, and other objects which make usage of the
    local ``schema`` name.

:param info: Optional data dictionary which will be populated into the
    :attr:`.SchemaItem.info` attribute of this object.

:param naming_convention: a dictionary referring to values which
  will establish default naming conventions for :class:`.Constraint`
  and :class:`.Index` objects, for those objects which are not given
  a name explicitly.

  The keys of this dictionary may be:

  * a constraint or Index class, e.g. the :class:`.UniqueConstraint`,
    :class:`_schema.ForeignKeyConstraint` class, the :class:`.Index`
    class

  * a string mnemonic for one of the known constraint classes;
    ``"fk"``, ``"pk"``, ``"ix"``, ``"ck"``, ``"uq"`` for foreign key,
    primary key, index, check, and unique constraint, respectively.

  * the string name of a user-defined "token" that can be used
    to define new naming tokens.

  The values associated with each "constraint class" or "constraint
  mnemonic" key are string naming templates, such as
  ``"uq_%(table_name)s_%(column_0_name)s"``,
  which describe how the name should be composed.  The values
  associated with user-defined "token" keys should be callables of the
  form ``fn(constraint, table)``, which accepts the constraint/index
  object and :class:`_schema.Table` as arguments, returning a string
  result.

  The built-in names are as follows, some of which may only be
  available for certain types of constraint:

    * ``%(table_name)s`` - the name of the :class:`_schema.Table`
      object
      associated with the constraint.

    * ``%(referred_table_name)s`` - the name of the
      :class:`_schema.Table`
      object associated with the referencing target of a
      :class:`_schema.ForeignKeyConstraint`.

    * ``%(column_0_name)s`` - the name of the :class:`_schema.Column`
      at
      index position "0" within the constraint.

    * ``%(column_0N_name)s`` - the name of all :class:`_schema.Column`
      objects in order within the constraint, joined without a
      separator.

    * ``%(column_0_N_name)s`` - the name of all
      :class:`_schema.Column`
      objects in order within the constraint, joined with an
      underscore as a separator.

    * ``%(column_0_label)s``, ``%(column_0N_label)s``,
      ``%(column_0_N_label)s`` - the label of either the zeroth
      :class:`_schema.Column` or all :class:`.Columns`, separated with
      or without an underscore

    * ``%(column_0_key)s``, ``%(column_0N_key)s``,
      ``%(column_0_N_key)s`` - the key of either the zeroth
      :class:`_schema.Column` or all :class:`.Columns`, separated with
      or without an underscore

    * ``%(referred_column_0_name)s``, ``%(referred_column_0N_name)s``
      ``%(referred_column_0_N_name)s``,  ``%(referred_column_0_key)s``,
      ``%(referred_column_0N_key)s``, ...  column tokens which
      render the names/keys/labels of columns that are referenced
      by a  :class:`_schema.ForeignKeyConstraint`.

    * ``%(constraint_name)s`` - a special key that refers to the
      existing name given to the constraint.  When this key is
      present, the :class:`.Constraint` object's existing name will be
      replaced with one that is composed from template string that
      uses this token. When this token is present, it is required that
      the :class:`.Constraint` is given an explicit name ahead of time.

    * user-defined: any additional token may be implemented by passing
      it along with a ``fn(constraint, table)`` callable to the
      naming_convention dictionary.

  .. versionadded:: 1.3.0 - added new ``%(column_0N_name)s``,
     ``%(column_0_N_name)s``, and related tokens that produce
     concatenations of names, keys, or labels for all columns referred
     to by a given constraint.

  .. seealso::

        :ref:`constraint_naming_conventions` - for detailed usage
        examples.



Vous êtes un professionnel et vous avez besoin d'une formation ? Mise en oeuvre d'IHM
avec Qt et PySide6
Voir le programme détaillé