MCPcopy Create free account
hub / github.com/sqlalchemy/sqlalchemy / _replace_params

Method _replace_params

lib/sqlalchemy/sql/elements.py:607–627  ·  view source on GitHub ↗
(
        self,
        unique: bool,
        optionaldict: Optional[Mapping[str, Any]],
        kwargs: Dict[str, Any],
    )

Source from the content-addressed store, hash-verified

605 return self._replace_params(False, __optionaldict, kwargs)
606
607 def _replace_params(
608 self,
609 unique: bool,
610 optionaldict: Optional[Mapping[str, Any]],
611 kwargs: Dict[str, Any],
612 ) -> Self:
613 if optionaldict:
614 kwargs.update(optionaldict)
615
616 def visit_bindparam(bind: BindParameter[Any]) -> None:
617 if bind.key in kwargs:
618 bind.value = kwargs[bind.key]
619 bind.required = False
620 if unique:
621 bind._convert_to_unique()
622
623 return cloned_traverse(
624 self,
625 {"maintain_key": True, "detect_subquery_cols": True},
626 {"bindparam": visit_bindparam},
627 )
628
629 def compare(self, other: ClauseElement, **kw: Any) -> bool:
630 r"""Compare this :class:`_expression.ClauseElement` to

Callers 2

unique_paramsMethod · 0.95
paramsMethod · 0.95

Calls 2

cloned_traverseFunction · 0.85
updateMethod · 0.45

Tested by

no test coverage detected