[NEWIMPORT] Move db insert into SQL.py (store_hand)

This commit is contained in:
Worros 2009-10-14 12:05:17 +08:00
parent 843bd754f6
commit 1fc015b09f
2 changed files with 39 additions and 35 deletions

View File

@ -1383,41 +1383,7 @@ class Database:
def storeHand(self, p): def storeHand(self, p):
#stores into table hands: #stores into table hands:
q = """INSERT INTO Hands ( q = self.sql.query['store_hand']
tablename,
gametypeid,
sitehandno,
handstart,
importtime,
seats,
maxseats,
texture,
playersVpi,
boardcard1,
boardcard2,
boardcard3,
boardcard4,
boardcard5,
playersAtStreet1,
playersAtStreet2,
playersAtStreet3,
playersAtStreet4,
playersAtShowdown,
street0Raises,
street1Raises,
street2Raises,
street3Raises,
street4Raises,
street1Pot,
street2Pot,
street3Pot,
street4Pot,
showdownPot
)
VALUES
(%s, %s, %s, %s, %s, %s, %s, %s, %s, %s,
%s, %s, %s, %s, %s, %s, %s, %s, %s, %s,
%s, %s, %s, %s, %s, %s, %s, %s, %s)"""
q = q.replace('%s', self.sql.query['placeholder']) q = q.replace('%s', self.sql.query['placeholder'])

View File

@ -3110,6 +3110,44 @@ class Sql:
self.query['handsPlayersTTypeId_joiner'] = " OR TourneysPlayersId+0=" self.query['handsPlayersTTypeId_joiner'] = " OR TourneysPlayersId+0="
self.query['handsPlayersTTypeId_joiner_id'] = " OR id=" self.query['handsPlayersTTypeId_joiner_id'] = " OR id="
self.query['store_hand'] = """INSERT INTO Hands (
tablename,
gametypeid,
sitehandno,
handstart,
importtime,
seats,
maxseats,
texture,
playersVpi,
boardcard1,
boardcard2,
boardcard3,
boardcard4,
boardcard5,
playersAtStreet1,
playersAtStreet2,
playersAtStreet3,
playersAtStreet4,
playersAtShowdown,
street0Raises,
street1Raises,
street2Raises,
street3Raises,
street4Raises,
street1Pot,
street2Pot,
street3Pot,
street4Pot,
showdownPot
)
VALUES
(%s, %s, %s, %s, %s, %s, %s, %s, %s, %s,
%s, %s, %s, %s, %s, %s, %s, %s, %s, %s,
%s, %s, %s, %s, %s, %s, %s, %s, %s)"""
if db_server == 'mysql': if db_server == 'mysql':