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 ? Coder avec une
Intelligence Artificielle
Voir le programme détaillé
Classe « URL »

Méthode sqlalchemy.URL.update_query_pairs

Signature de la méthode update_query_pairs

def update_query_pairs(self, key_value_pairs: 'Iterable[Tuple[str, Union[str, List[str]]]]', append: 'bool' = False) -> 'URL' 

Description

help(URL.update_query_pairs)

Return a new :class:`_engine.URL` object with the
:attr:`_engine.URL.query`
parameter dictionary updated by the given sequence of key/value pairs

E.g.::

    >>> from sqlalchemy.engine import make_url
    >>> url = make_url("postgresql+psycopg2://user:pass@host/dbname")
    >>> url = url.update_query_pairs(
    ...     [
    ...         ("alt_host", "host1"),
    ...         ("alt_host", "host2"),
    ...         ("ssl_cipher", "/path/to/crt"),
    ...     ]
    ... )
    >>> str(url)
    'postgresql+psycopg2://user:pass@host/dbname?alt_host=host1&alt_host=host2&ssl_cipher=%2Fpath%2Fto%2Fcrt'

:param key_value_pairs: A sequence of tuples containing two strings
 each.

:param append: if True, parameters in the existing query string will
 not be removed; new parameters will be in addition to those present.
 If left at its default of False, keys present in the given query
 parameters will replace those of the existing query string.

.. versionadded:: 1.4

.. seealso::

    :attr:`_engine.URL.query`

    :meth:`_engine.URL.difference_update_query`

    :meth:`_engine.URL.set`



Vous êtes un professionnel et vous avez besoin d'une formation ? Machine Learning
avec Scikit-Learn
Voir le programme détaillé