MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_bulk_save

Function test_bulk_save

examples/performance/single_inserts.py:59–72  ·  view source on GitHub ↗

Individual INSERT/COMMIT pairs using the "bulk" API

(n)

Source from the content-addressed store, hash-verified

57
58@Profiler.profile
59def test_bulk_save(n):
60 """Individual INSERT/COMMIT pairs using the "bulk" API"""
61
62 for i in range(n):
63 session = Session(bind=engine)
64 session.bulk_save_objects(
65 [
66 Customer(
67 name="customer name %d" % i,
68 description="customer description %d" % i,
69 )
70 ]
71 )
72 session.commit()
73
74
75@Profiler.profile

Callers

nothing calls this directly

Calls 4

bulk_save_objectsMethod · 0.95
commitMethod · 0.95
SessionClass · 0.90
CustomerClass · 0.70

Tested by

no test coverage detected