MCPcopy Create free account
hub / github.com/adcontextprotocol/adcp / batchInsertActivity

Method batchInsertActivity

server/src/db/catalog-db.ts:845–865  ·  view source on GitHub ↗
(
    client: PoolClient,
    entries: Array<{ property_rid: string; member_id: string; provenance_type: string; provenance_context: string | null }>
  )

Source from the content-addressed store, hash-verified

843 }
844
845 private async batchInsertActivity(
846 client: PoolClient,
847 entries: Array<{ property_rid: string; member_id: string; provenance_type: string; provenance_context: string | null }>
848 ): Promise<void> {
849 if (entries.length === 0) return;
850
851 const values: any[] = [];
852 const placeholders: string[] = [];
853 let idx = 1;
854
855 for (const entry of entries) {
856 placeholders.push(`($${idx++}, $${idx++}, $${idx++}, $${idx++}, $${idx++})`);
857 values.push(uuidv7(), entry.property_rid, entry.member_id, entry.provenance_type, entry.provenance_context);
858 }
859
860 await client.query(
861 `INSERT INTO catalog_activity (id, property_rid, member_id, provenance_type, provenance_context)
862 VALUES ${placeholders.join(', ')}`,
863 values
864 );
865 }
866
867 // ─── Public Registry ────────────────────────────────────────────────────────
868

Callers 1

resolveIdentifiersMethod · 0.95

Calls 2

uuidv7Function · 0.85
queryMethod · 0.80

Tested by

no test coverage detected