@Profiler.profile
def test_dbapi_raw(n):
 conn = engine.pool._creator()
 cursor = conn.cursor()
 compiled = Customer.__table__.insert().values(name=bindparam('name'), description=bindparam('description')).compile(dialect=engine.dialect)
 if compiled.positional:
  args = ((('customer name %d' % i), ('customer description %d' % i)) for i in range(n))
 else:
  args = (dict(name=('customer name %d' % i), description=('customer description %d' % i)) for i in range(n))
 cursor.executemany(str(compiled), list(args))
 conn.commit()
 conn.close()

@ Profiler . profile def test_dbapi_raw ( n ) : conn = engine . pool . _creator ( ) cursor = conn . cursor ( ) compiled = Customer . __table__ . insert ( ) . values ( name = bindparam ( 'name' ) , description = bindparam ( 'description' ) ) . compile ( dialect = engine . dialect ) if compiled . positional : args = ( ( ( 'customer name %d' % i ) , ( 'customer description %d' % i ) ) for i in range ( n ) ) else : args = ( dict ( name = ( 'customer name %d' % i ) , description = ( 'customer description %d' % i ) ) for i in range ( n ) ) cursor . executemany ( str ( compiled ) , list ( args ) ) conn . commit ( ) conn . close ( )
the dbapis api inserting rows in bulk .