MCPcopy
hub / github.com/electric-sql/pglite / doMapColumns

Function doMapColumns

packages/pglite-sync/src/apply.ts:233–245  ·  view source on GitHub ↗
(
  mapColumns: MapColumns,
  message: ChangeMessage<any>,
)

Source from the content-addressed store, hash-verified

231}
232
233function doMapColumns(
234 mapColumns: MapColumns,
235 message: ChangeMessage<any>,
236): Record<string, any> {
237 if (typeof mapColumns === 'function') {
238 return mapColumns(message)
239 }
240 const mappedColumns: Record<string, any> = {}
241 for (const [key, value] of Object.entries(mapColumns)) {
242 mappedColumns[key] = message.value[value]
243 }
244 return mappedColumns
245}

Callers 4

applyMessageToTableFunction · 0.85
applyInsertsToTableFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected