MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / freeze

Method freeze

lib/sqlalchemy/engine/result.py:1148–1169  ·  view source on GitHub ↗

Return a callable object that will produce copies of this :class:`_engine.Result` when invoked. The callable object returned is an instance of :class:`_engine.FrozenResult`. This is used for result set caching. The method must be called on the result when i

(self)

Source from the content-addressed store, hash-verified

1146 )
1147
1148 def freeze(self) -> FrozenResult[Unpack[_Ts]]:
1149 """Return a callable object that will produce copies of this
1150 :class:`_engine.Result` when invoked.
1151
1152 The callable object returned is an instance of
1153 :class:`_engine.FrozenResult`.
1154
1155 This is used for result set caching. The method must be called
1156 on the result when it has been unconsumed, and calling the method
1157 will consume the result fully. When the :class:`_engine.FrozenResult`
1158 is retrieved from a cache, it can be called any number of times where
1159 it will produce a new :class:`_engine.Result` object each time
1160 against its stored set of rows.
1161
1162 .. seealso::
1163
1164 :ref:`do_orm_execute_re_executing` - example usage within the
1165 ORM to implement a result-set cache.
1166
1167 """
1168
1169 return FrozenResult(self)
1170
1171 def merge(
1172 self, *others: Result[Unpack[TupleAny]]

Callers 15

test_freezeMethod · 0.45
test_ambiguous_columnMethod · 0.45
test_generative_casesMethod · 0.45
result_oneFunction · 0.45
test_freezeMethod · 0.45
test_columns_freezeMethod · 0.45
test_scalars_freezeMethod · 0.45
get_valueMethod · 0.45
get_valueMethod · 0.45

Calls 1

FrozenResultClass · 0.85

Tested by 14

test_freezeMethod · 0.36
test_ambiguous_columnMethod · 0.36
test_generative_casesMethod · 0.36
test_freezeMethod · 0.36
test_columns_freezeMethod · 0.36
test_scalars_freezeMethod · 0.36
get_valueMethod · 0.36
get_valueMethod · 0.36