MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / _replace_params

Method _replace_params

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

Source from the content-addressed store, hash-verified

620 "statement level objects such as select(), insert(), union(), etc. ",
621 )
622 def _replace_params(
623 self,
624 unique: bool,
625 optionaldict: Optional[Mapping[str, Any]],
626 kwargs: Dict[str, Any],
627 ) -> Self:
628 if optionaldict:
629 kwargs.update(optionaldict)
630
631 def visit_bindparam(bind: BindParameter[Any]) -> None:
632 if bind.key in kwargs:
633 bind.value = kwargs[bind.key]
634 bind.required = False
635 if unique:
636 bind._convert_to_unique()
637
638 return cloned_traverse(
639 self,
640 {"maintain_key": True, "detect_subquery_cols": True},
641 {"bindparam": visit_bindparam},
642 )
643
644 def compare(self, other: ClauseElement, **kw: Any) -> bool:
645 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