@@ -479,6 +479,21 @@ def _transaction_test(self):
479479 res2 = self .pandasSQL .read_query ('SELECT * FROM test_trans' )
480480 assert len (res2 ) == 1
481481
482+ def _test_insert_multivalues (self ):
483+ db = sql .SQLDatabase (self .conn )
484+ df = DataFrame ({'A' : [1 , 0 , 0 ], 'B' : [1.1 , 0.2 , 4.3 ]})
485+ table = sql .SQLTable ("test_table" , db , frame = df )
486+ data = [
487+ {'A' : 1 , 'B' : 0.46 },
488+ {'A' : 0 , 'B' : - 2.06 }
489+ ]
490+ statement = table .insert_statement (data , conn = self .conn )[0 ]
491+ dialect = getattr (self .conn , 'dialect' , None )
492+ if dialect and getattr (dialect , 'supports_multivalues_insert' , False ):
493+ assert statement .parameters == data , 'insert statement should be multivalues'
494+ else :
495+ assert statement .parameters is None , 'insert statement should not be multivalues'
496+
482497
483498# -----------------------------------------------------------------------------
484499# -- Testing the public API
@@ -1665,6 +1680,9 @@ class Temporary(Base):
16651680
16661681 tm .assert_frame_equal (df , expected )
16671682
1683+ def test_insert_multivalues (self ):
1684+ self ._test_insert_multivalues ()
1685+
16681686
16691687class _TestSQLAlchemyConn (_EngineToConnMixin , _TestSQLAlchemy ):
16701688
0 commit comments