@Profiler.profile
def test_bulk_save_return_pks(n):
 session = Session(bind=engine)
 session.bulk_save_objects([Customer(name=('customer name %d' % i), description=('customer description %d' % i)) for i in range(n)], return_defaults=True)
 session.commit()

@ Profiler . profile def test_bulk_save_return_pks ( n ) : session = Session ( bind = engine ) session . bulk_save_objects ( [ Customer ( name = ( 'customer name %d' % i ) , description = ( 'customer description %d' % i ) ) for i in range ( n ) ] , return_defaults = True ) session . commit ( )
individual insert statements in "bulk" .