MCPcopy Create free account
hub / github.com/Shopify/ghostferry / AsSQLString

Method AsSQLString

dml_events.go:224–234  ·  view source on GitHub ↗
(schemaName, tableName string)

Source from the content-addressed store, hash-verified

222}
223
224func (e *BinlogUpdateEvent) AsSQLString(schemaName, tableName string) (string, error) {
225 if err := verifyValuesHasTheSameLengthAsColumns(e.table, e.oldValues, e.newValues); err != nil {
226 return "", err
227 }
228
229 query := "UPDATE " + QuotedTableNameFromString(schemaName, tableName) +
230 " SET " + buildStringMapForSet(e.table.Columns, e.newValues) +
231 " WHERE " + buildStringMapForWhere(e.table.Columns, e.oldValues)
232
233 return query, nil
234}
235
236func (e *BinlogUpdateEvent) PaginationKey() (string, error) {
237 return paginationKeyFromEventData(e.table, e.newValues)

Callers

nothing calls this directly

Calls 4

buildStringMapForSetFunction · 0.85
buildStringMapForWhereFunction · 0.85

Tested by

no test coverage detected