MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_orm_commit

Function test_orm_commit

examples/performance/single_inserts.py:44–55  ·  view source on GitHub ↗

Individual INSERT/COMMIT pairs via the ORM

(n)

Source from the content-addressed store, hash-verified

42
43@Profiler.profile
44def test_orm_commit(n):
45 """Individual INSERT/COMMIT pairs via the ORM"""
46
47 for i in range(n):
48 session = Session(bind=engine)
49 session.add(
50 Customer(
51 name="customer name %d" % i,
52 description="customer description %d" % i,
53 )
54 )
55 session.commit()
56
57
58@Profiler.profile

Callers

nothing calls this directly

Calls 4

addMethod · 0.95
commitMethod · 0.95
SessionClass · 0.90
CustomerClass · 0.70

Tested by

no test coverage detected