grr/server/grr_response_server/databases/mysql_flows.py
def WriteMessageHandlerRequests(self, requests, cursor=None):
    """Writes a list of message handler requests to the database."""
    query = ("INSERT IGNORE INTO message_handler_requests "
             "(handlername, timestamp, request_id, request) VALUES ")
    now = mysql_utils.RDFDatetimeToMysqlString(rdfvalue.RDFDatetime.Now())

    value_templates = []
    args = []
    for r in requests:
      args.extend([r.handler_name, now, r.request_id, r.SerializeToString()])
      value_templates.append("(%s, %s, %s, %s)")

    query += ",".join(value_templates)
    cursor.execute(query, args)
Writes a list of message handler requests to the database.
Writes a list of message handler requests to the database.
Writes a list of message handler requests to the database .
def WriteMessageHandlerRequests(self, requests, cursor=None):
    query = ("INSERT IGNORE INTO message_handler_requests "
             "(handlername, timestamp, request_id, request) VALUES ")
    now = mysql_utils.RDFDatetimeToMysqlString(rdfvalue.RDFDatetime.Now())
    value_templates = []
    args = []
    for r in requests:
      args.extend([r.handler_name, now, r.request_id, r.SerializeToString()])
      value_templates.append("(%s, %s, %s, %s)")
    query += ",".join(value_templates)
    cursor.execute(query, args)
def WriteMessageHandlerRequests ( self , requests , cursor = None ) : query = ( "INSERT IGNORE INTO message_handler_requests " "(handlername, timestamp, request_id, request) VALUES " ) now = mysql_utils . RDFDatetimeToMysqlString ( rdfvalue . RDFDatetime . Now ( ) ) value_templates = [ ] args = [ ] for r in requests : args . extend ( [ r . handler_name , now , r . request_id , r . SerializeToString ( ) ] ) value_templates . append ( "(%s, %s, %s, %s)" ) query += "," . join ( value_templates ) cursor . execute ( query , args )
Writes a list of message handler requests to the database.
Writes a list of message handler requests to the database .
"""Writes a list of message handler requests to the database."""
self
requests
cursor