MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_core_reuse_stmt

Function test_core_reuse_stmt

examples/performance/short_selects.py:152–159  ·  view source on GitHub ↗

test core, reusing the same statement, no cache

(n)

Source from the content-addressed store, hash-verified

150
151@Profiler.profile
152def test_core_reuse_stmt(n):
153 """test core, reusing the same statement, no cache"""
154
155 stmt = select(Customer.__table__).where(Customer.id == bindparam("id"))
156 with engine.connect() as conn:
157 for id_ in random.sample(ids, n):
158 row = conn.execute(stmt, {"id": id_}).first()
159 tuple(row)
160
161
162@Profiler.profile

Callers

nothing calls this directly

Calls 6

selectFunction · 0.90
bindparamFunction · 0.90
whereMethod · 0.45
connectMethod · 0.45
firstMethod · 0.45
executeMethod · 0.45

Tested by

no test coverage detected