Make previous executemany() function the default
This commit is contained in:
parent
208176077e
commit
e9853c1ff2
|
@ -29,7 +29,6 @@ MYSQL_INNODB = 2
|
|||
PGSQL = 3
|
||||
SQLITE = 4
|
||||
|
||||
DBTEST = False
|
||||
|
||||
# Data Structures for index and foreign key creation
|
||||
# drop_code is an int with possible values: 0 - don't drop for bulk import
|
||||
|
@ -1517,13 +1516,9 @@ def storeActions(cursor, handsPlayersIds, actionTypes, allIns, actionAmounts, ac
|
|||
for i in xrange(len(actionTypes)): #iterate through streets
|
||||
for j in xrange(len(actionTypes[i])): #iterate through names
|
||||
for k in xrange(len(actionTypes[i][j])): #iterate through individual actions of that player on that street
|
||||
if DBTEST == False:
|
||||
cursor.execute("INSERT INTO HandsActions (handPlayerId, street, actionNo, action, allIn, amount) VALUES (%s, %s, %s, %s, %s, %s)", (handsPlayersIds[j], i, actionNos[i][j][k], actionTypes[i][j][k], allIns[i][j][k], actionAmounts[i][j][k]))
|
||||
else:
|
||||
# Add inserts into a list and let
|
||||
inserts = inserts + [(handsPlayersIds[j], i, actionNos[i][j][k], actionTypes[i][j][k], allIns[i][j][k], actionAmounts[i][j][k])]
|
||||
|
||||
if DBTEST == True:
|
||||
cursor.executemany("INSERT INTO HandsActions (handPlayerId, street, actionNo, action, allIn, amount) VALUES (%s, %s, %s, %s, %s, %s)", inserts)
|
||||
#end def storeActions
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user