MCPcopy Create free account
hub / github.com/BIT-DataLab/LakeBench / insert

Method insert

join/LSH/datasketch/storage.py:518–533  ·  view source on GitHub ↗

Insert an iterable of values with the same key. :param byte|str key: the key :param iterable[byte|str] vals: the iterable of values :param boolean buffer: whether the insert statements should be buffered

(self, key, vals, buffer=False)

Source from the content-addressed store, hash-verified

516 self._execute(buffer)
517
518 def insert(self, key, vals, buffer=False):
519 """
520 Insert an iterable of values with the same key.
521
522 :param byte|str key: the key
523 :param iterable[byte|str] vals: the iterable of values
524 :param boolean buffer: whether the insert statements should be buffered
525 """
526 statements_and_parameters = [
527 (self._stmt_insert, (self._key_encoder(key), self._val_encoder(val), self._ts()))
528 for val in vals
529 ]
530 if buffer:
531 self._buffer(statements_and_parameters)
532 else:
533 self._execute(statements_and_parameters)
534
535 def upsert(self, key, vals, buffer=False):
536 """

Callers

nothing calls this directly

Calls 2

_bufferMethod · 0.95
_executeMethod · 0.95

Tested by

no test coverage detected