API reference › @evolu/common › local‑first/Evolu › DeviceMutation

type DeviceMutation<D extends EvoluSchema, Kind extends MutationKind> = <
  TableName,
>(
  table: TableName,
  values: MutationValues<D[TableName], Kind>,
  ...options: [TableName] extends [`_${string}`]
    ? [options?: MutationOptions<ShardOwner | SharedOwner>]
    : [
        options: MutationOptions<ShardOwner | SharedOwner> & {
          owner: ShardOwner | SharedOwner;
        },
      ]
) => {
  id: InferOutput<D[TableName]["id"]>;
};

Defined in: packages/common/src/local-first/Evolu.ts:2089

A Mutation of a DeviceEvolu. The device owner never syncs, so a mutation of a synced table, one whose name doesn't start with _, takes options with the owner the app syncs that table's rows with, which isn't an AppOwner. A local-only table's rows stay on this device, so its mutations need no owner.