connectordb/logger.py
def insert_many(self, data_dict):
        """ Inserts data into the cache, if the data is a dict of the form {streamname: [{"t": timestamp,"d":data,...]}"""
        c = self.database.cursor()
        c.execute("BEGIN TRANSACTION;")
        try:
            for streamname in data_dict:
                if streamname not in self.streams:
                    raise Exception(
                        "The stream '%s' was not found" % (streamname, ))
                for dp in data_dict[streamname]:
                    validate(dp["d"], self.streams[streamname])
                    c.execute("INSERT INTO cache VALUES (?,?,?);",
                              (streamname, dp["t"], dp["d"]))
        except:
            c.execute("ROLLBACK;")
            raise
        c.exectute("COMMIT;")
def insert_many(self, data_dict):
        """ Inserts data into the cache, if the data is a dict of the form {streamname: [{"t": timestamp,"d":data,...]}"""
        c = self.database.cursor()
        c.execute("BEGIN TRANSACTION;")
        try:
            for streamname in data_dict:
                if streamname not in self.streams:
                    raise Exception(
                        "The stream '%s' was not found" % (streamname, ))
                for dp in data_dict[streamname]:
                    validate(dp["d"], self.streams[streamname])
                    c.execute("INSERT INTO cache VALUES (?,?,?);",
                              (streamname, dp["t"], dp["d"]))
        except:
            c.execute("ROLLBACK;")
            raise
        c.exectute("COMMIT;")
def insert_many ( self , data_dict ) : c = self . database . cursor ( ) c . execute ( "BEGIN TRANSACTION;" ) try : for streamname in data_dict : if streamname not in self . streams : raise Exception ( "The stream '%s' was not found" % ( streamname , ) ) for dp in data_dict [ streamname ] : validate ( dp [ "d" ] , self . streams [ streamname ] ) c . execute ( "INSERT INTO cache VALUES (?,?,?);" , ( streamname , dp [ "t" ] , dp [ "d" ] ) ) except : c . execute ( "ROLLBACK;" ) raise c . exectute ( "COMMIT;" )
Inserts data into the cache, if the data is a dict of the form {streamname: [{"t": timestamp,"d":data,...]}
Inserts data into the cache if the data is a dict of the form { streamname : [ { t : timestamp d : data ... ] }