示例#1
0
def addRunk(name):
    connection = dbAccessor.db()
    user = connection.query(__getUserQuery, (name, ), False, True)
    if not user:
        connection.query(__insertUserQuery, (name, ), True)
    timestamp = datetime.today().isoformat()
    params = (name, timestamp)
    execution = connection.query(__addRunkQuery, params, True)
    return execution
示例#2
0
def delCommand(phrase):
    connection = dbAccessor.db()
    return connection.query(__delCommandQuery, (phrase, ), True)
示例#3
0
def listCommands():
    connection = dbAccessor.db()
    return connection.query(__getAllCommandsQuery)
示例#4
0
def getCommand(phrase):
    connection = dbAccessor.db()
    return connection.query(__getCommandQuery, (phrase, ), False, True)
示例#5
0
def addCommand(phrase, msg):
    connection = dbAccessor.db()
    params = (phrase, msg)
    connection.query(__addCommandQuery, params, True)
示例#6
0
def getRunkHighscore():
    connection = dbAccessor.db()
    return connection.query(__getRunksHighscoreQuery)
示例#7
0
def getRunkHighscoreByUsername(name):
    connection = dbAccessor.db()
    return connection.query(__getRunksHighscoreByUserQuery, (name, ),
                            single=True)
示例#8
0
def getUser(name):
    connection = dbAccessor.db()
    return connection.query(__getUserQuery, (name, ), False, True)
示例#9
0
def saveUser(name):
    connection = dbAccessor.db()
    connection.query(__insertUserQuery, (name, ), True)