MCPcopy Create free account
hub / github.com/TanStack/db / mapOperationToPowerSync

Function mapOperationToPowerSync

packages/powersync-db-collection/src/helpers.ts:101–112  ·  view source on GitHub ↗
(operation: string)

Source from the content-addressed store, hash-verified

99 * Maps TanstackDB operations to {@link DiffTriggerOperation}
100 */
101export function mapOperationToPowerSync(operation: string) {
102 switch (operation) {
103 case `insert`:
104 return DiffTriggerOperation.INSERT
105 case `update`:
106 return DiffTriggerOperation.UPDATE
107 case `delete`:
108 return DiffTriggerOperation.DELETE
109 default:
110 throw new Error(`Unknown operation ${operation} received`)
111 }
112}

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected