MCPcopy Create free account
hub / github.com/clientdb/clientdb / getIdKeyForEntity

Function getIdKeyForEntity

engine/server/mutation.ts:7–15  ·  view source on GitHub ↗
(schema: DbSchema, entity: string)

Source from the content-addressed store, hash-verified

5import { SyncRequestContext } from "./context";
6
7function getIdKeyForEntity(schema: DbSchema, entity: string) {
8 const entitySchema = schema.entities.find((e) => e.name === entity);
9
10 if (!entitySchema) {
11 throw new Error(`Unknown entity ${entity}`);
12 }
13
14 return entitySchema.idField;
15}
16
17export async function performMutation(
18 context: SyncRequestContext,

Callers 1

performMutationFunction · 0.85

Calls 1

findMethod · 0.65

Tested by

no test coverage detected