MCPcopy Create free account
hub / github.com/electric-sql/electric / applyChanges

Function applyChanges

examples/linearlite/server.ts:62–72  ·  view source on GitHub ↗
(changes: ChangeSet)

Source from the content-addressed store, hash-verified

60})
61
62async function applyChanges(changes: ChangeSet) {
63 const { issues, comments } = changes
64 await sql.begin(async (sql) => {
65 for (const issue of issues) {
66 await applyTableChange(`issue`, issue, sql)
67 }
68 for (const comment of comments) {
69 await applyTableChange(`comment`, comment, sql)
70 }
71 })
72}
73
74async function applyTableChange(
75 tableName: `issue` | `comment`,

Callers 1

server.tsFile · 0.70

Calls 1

applyTableChangeFunction · 0.70

Tested by

no test coverage detected