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

Method splice_vertically

lib/sqlalchemy/engine/cursor.py:1933–1963  ·  view source on GitHub ↗

Return a new :class:`.CursorResult` that "vertically splices", i.e. "extends", the rows of this :class:`.CursorResult` with that of another :class:`.CursorResult`. .. tip:: This method is for the benefit of the SQLAlchemy ORM and is not intended for general use.

(self, other: CursorResult[Any])

Source from the content-addressed store, hash-verified

1931 return clone
1932
1933 def splice_vertically(self, other: CursorResult[Any]) -> Self:
1934 """Return a new :class:`.CursorResult` that "vertically splices",
1935 i.e. "extends", the rows of this :class:`.CursorResult` with that of
1936 another :class:`.CursorResult`.
1937
1938 .. tip:: This method is for the benefit of the SQLAlchemy ORM and is
1939 not intended for general use.
1940
1941 "vertically splices" means the rows of the given result are appended to
1942 the rows of this cursor result. The incoming :class:`.CursorResult`
1943 must have rows that represent the identical list of columns in the
1944 identical order as they are in this :class:`.CursorResult`.
1945
1946 .. versionadded:: 2.0
1947
1948 .. seealso::
1949
1950 :meth:`.CursorResult.splice_horizontally`
1951
1952 """
1953 clone = self._generate()
1954 total_rows = list(self._raw_row_iterator()) + list(
1955 other._raw_row_iterator()
1956 )
1957
1958 clone.cursor_strategy = FullyBufferedCursorFetchStrategy(
1959 None,
1960 initial_buffer=total_rows,
1961 )
1962 clone._reset_memoizations()
1963 return clone
1964
1965 def _rewind(self, rows: Any) -> Self:
1966 """rewind this result back to the given rowset.

Callers 1

_emit_insert_statementsFunction · 0.80

Calls 4

_raw_row_iteratorMethod · 0.95
_reset_memoizationsMethod · 0.80
_generateMethod · 0.45

Tested by

no test coverage detected