Skip to content

Commit 5c0a06e

Browse files
authored
feat: Make getColumnChangeSummary public for use in plugins (#2260)
In the ClickHouse destination, we want to add some additional information about table-level changes (sort keys, partition keys) to that provided by `GetChangesSummary`. However right now, that would mean duplicating quite a lot of code, so I would like to suggest that we instead make `GetColumnChangeSummary` public for use in this case and others like it.
1 parent 8721bdc commit 5c0a06e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

schema/table.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ func (t TableColumnChange) String() string {
260260
}
261261
}
262262

263-
func getColumnChangeSummary(change TableColumnChange) string {
263+
func GetColumnChangeSummary(change TableColumnChange) string {
264264
switch change.Type {
265265
case TableColumnChangeTypeAdd:
266266
if change.Current.PrimaryKey {
@@ -342,7 +342,7 @@ func GetChangesSummary(tablesChanges map[string][]TableColumnChange) string {
342342
summary.WriteString(fmt.Sprintf("%s:\n", table))
343343
changes := tablesChanges[table]
344344
changesString := lo.Map(changes, func(change TableColumnChange, _ int) string {
345-
return fmt.Sprintf(" - %s", getColumnChangeSummary(change))
345+
return fmt.Sprintf(" - %s", GetColumnChangeSummary(change))
346346
})
347347
slices.Sort(changesString)
348348
summary.WriteString(strings.Join(changesString, "\n"))

0 commit comments

Comments
 (0)