MCPcopy Create free account
hub / github.com/AgentOps-AI/agentops / insert

Method insert

app/e2e/sdk-api/src/supabase.py:54–71  ·  view source on GitHub ↗
(self, table: str, data)

Source from the content-addressed store, hash-verified

52 return response.status_code == 204
53
54 async def insert(self, table: str, data):
55 logging.info(f"Inserting to {table} table: {data}")
56 table_url = f"{self.supabase_url}/rest/v1/{table}"
57 headers = {
58 "apiKey": self.supabase_key,
59 "Authorization": f"Bearer {self.supabase_key}",
60 }
61
62 async with httpx.AsyncClient() as async_client:
63 response = await async_client.post(table_url, json=data, headers=headers)
64
65 if not response.is_success:
66 json = response.json()
67 raise RuntimeError(
68 f"Error inserting to {table=}. Postgres: {json['code']=}. {json['message']=}"
69 )
70
71 return response
72
73 async def upsert(self, table: str, pkey_name: str, data):
74 logging.info(f"Upserting to {table} table: {data}")

Callers 10

run.pyFile · 0.80
create_sessionFunction · 0.80
v2_create_sessionFunction · 0.80
v2_create_eventsFunction · 0.80
v2_developer_errorsFunction · 0.80
clickhouse_createFunction · 0.80
test_trace_dataFunction · 0.80
test_span_dataFunction · 0.80

Calls 2

jsonMethod · 0.80
postMethod · 0.45

Tested by 2

test_trace_dataFunction · 0.64
test_span_dataFunction · 0.64