MCPcopy Create free account
hub / github.com/cosdata/cosdata / create_transaction

Function create_transaction

tests/test-key-value-store.py:46–51  ·  view source on GitHub ↗
(name)

Source from the content-addressed store, hash-verified

44 raise Exception(f"Failed to create TF-IDF index: {response.text}")
45
46def create_transaction(name):
47 url = f"{client.base_url}/collections/{name}/transactions"
48 response = requests.post(url, headers=client._get_headers(), verify=client.verify_ssl)
49 if response.status_code not in [200, 201]:
50 raise Exception(f"Failed to create transaction: {response.text}")
51 return response.json()["transaction_id"]
52
53def commit_transaction(name, txn_id):
54 url = f"{client.base_url}/collections/{name}/transactions/{txn_id}/commit"

Callers 2

run_in_txnFunction · 0.70
test_transaction_abortFunction · 0.70

Calls 1

_get_headersMethod · 0.45

Tested by

no test coverage detected