MCPcopy Index your code
hub / github.com/zzzeek/sqlalchemy / _get_embedded_bindparams

Method _get_embedded_bindparams

lib/sqlalchemy/sql/elements.py:555–575  ·  view source on GitHub ↗

Return the list of :class:`.BindParameter` objects embedded in the object. This accomplishes the same purpose as ``visitors.traverse()`` or similar would provide, however by making use of the cache key it takes advantage of memoization of the key to result in fewer

(self)

Source from the content-addressed store, hash-verified

553 ).scalar()
554
555 def _get_embedded_bindparams(self) -> Sequence[BindParameter[Any]]:
556 """Return the list of :class:`.BindParameter` objects embedded in the
557 object.
558
559 This accomplishes the same purpose as ``visitors.traverse()`` or
560 similar would provide, however by making use of the cache key
561 it takes advantage of memoization of the key to result in fewer
562 net method calls, assuming the statement is also going to be
563 executed.
564
565 """
566
567 key = self._generate_cache_key()
568 if key is None:
569 bindparams: List[BindParameter[Any]] = []
570
571 traverse(self, {}, {"bindparam": bindparams.append})
572 return bindparams
573
574 else:
575 return key.bindparams
576
577 def unique_params(
578 self,

Callers 3

_bulk_insertFunction · 0.80
_bulk_updateFunction · 0.80

Calls 2

traverseFunction · 0.85
_generate_cache_keyMethod · 0.45

Tested by 1