MCPcopy Create free account
hub / github.com/Keeper-Security/Commander / put

Method put

keepercommander/storage/sqlite_dao.py:386–404  ·  view source on GitHub ↗
(self, entities)

Source from the content-addressed store, hash-verified

384 return d
385
386 def put(self, entities): # type: (Union[Any, Sequence[Any]]) -> None
387 key = 'put-entities'
388 query = self._queries.get(key)
389 if not query:
390 cols = []
391 if self.schema.owner_column:
392 cols.append(self.schema.owner_column)
393 cols.extend(self.schema.columns)
394 query = f'INSERT OR REPLACE INTO {self.schema.table_name} (' + ', '.join(cols) + ') VALUES (' + \
395 ', '.join((f':{x}' for x in cols)) + ')'
396 self._queries[key] = query
397
398 conn = self.get_connection()
399 try:
400 conn.executemany(query, (self.get_entity_values(x) for x in entities))
401 conn.commit()
402 except Exception as e:
403 conn.rollback()
404 raise e

Callers 6

executeMethod · 0.80
submit_requestMethod · 0.80
put_entitiesMethod · 0.80
put_linksMethod · 0.80
storeMethod · 0.80

Calls 3

get_entity_valuesMethod · 0.95
getMethod · 0.80
get_connectionMethod · 0.80

Tested by

no test coverage detected