MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / _with_value

Method _with_value

lib/sqlalchemy/sql/elements.py:2161–2171  ·  view source on GitHub ↗

Return a copy of this :class:`.BindParameter` with the given value set.

(self, value, maintain_key=False, required=NO_ARG)

Source from the content-addressed store, hash-verified

2159 self.type = type_
2160
2161 def _with_value(self, value, maintain_key=False, required=NO_ARG):
2162 """Return a copy of this :class:`.BindParameter` with the given value
2163 set.
2164 """
2165 cloned = self._clone(maintain_key=maintain_key)
2166 cloned.value = value
2167 cloned.callable = None
2168 cloned.required = required if required is not NO_ARG else self.required
2169 if cloned.type is type_api.NULLTYPE:
2170 cloned.type = type_api._resolve_value_to_type(value)
2171 return cloned
2172
2173 @property
2174 def effective_value(self) -> Optional[_T]:

Callers 6

_py_wrapper_literalMethod · 0.95
bindparamsMethod · 0.80
_gen_cache_keyMethod · 0.80
visit_override_bindsMethod · 0.80
_retrieve_tracker_recMethod · 0.80

Calls 1

_cloneMethod · 0.95

Tested by

no test coverage detected