mirror of
https://github.com/Syngnat/GoNavi.git
synced 2026-08-11 17:23:48 +08:00
- 聚合表级失败并保留已确认提交计数,避免任务误报成功 - 绑定分析上下文与实际同步模式,阻止陈旧或无效配置执行 - 加固全量覆盖及同端点分页写入,补充跨库与失败回归测试 Refs #846
23 lines
821 B
Go
23 lines
821 B
Go
package sync
|
||
|
||
// TableOptions controls which operations to apply per table, and optional row selection.
|
||
// 注意:如未指定 Selected*PKs,则表示“同步全部该类型差异数据”;如指定为空数组,则同样表示全部。
|
||
type TableOptions struct {
|
||
Insert bool `json:"insert,omitempty"`
|
||
Update bool `json:"update,omitempty"`
|
||
Delete bool `json:"delete,omitempty"`
|
||
|
||
SelectedInsertPKs []string `json:"selectedInsertPks,omitempty"`
|
||
SelectedUpdatePKs []string `json:"selectedUpdatePks,omitempty"`
|
||
SelectedDeletePKs []string `json:"selectedDeletePks,omitempty"`
|
||
}
|
||
|
||
func hasEffectiveSyncDataOperation(mode string, opts TableOptions) bool {
|
||
switch normalizeSyncMode(mode) {
|
||
case "insert_only", "full_overwrite":
|
||
return opts.Insert
|
||
default:
|
||
return opts.Insert || opts.Update || opts.Delete
|
||
}
|
||
}
|