跳到正文
Skillpedia
数据库41k · #6971

tuning-incremental-sync-config

它能做什么

这项技能让智能体调整已连接到 PostHog 数据仓库的数据表的同步设置。适合那些同步太频繁、太慢或追踪字段设置有误的人。

适用场景

  • ✓当你想把表从全量刷新切换为增量同步的时候。
  • ✓当某张表同步太慢或太频繁,你想修改其计划的时候。
  • ✓当源表发生了变化,其同步设置需要跟上的时候。

技能链接

https://github.com/PostHog/posthog/blob/master/products/warehouse_sources/skills/tuning-incremental-sync-config/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/PostHog/posthog/blob/master/products/warehouse_sources/skills/tuning-incremental-sync-config/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“请把我的 orders 表切换为只同步新行,并把计划改为每天运行一次。”

每周 5 个新技能,1 分钟读完。

工作原理

智能体会读取该表当前的设置,并更新你要求的项目。大多数更改会在下一次同步时生效,但有少数更改(例如修改主键)需要格外小心,以免损坏数据。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Tuning incremental sync config

A sync's configuration lives on the ExternalDataSchema and can be changed any time via external-data-schemas-partial-update. Most changes are non-destructive (take effect on the next sync), but a few (switching sync_type, changing primary keys) require careful handling to avoid corrupting the synced data.

When to use this skill

  • The user wants to change how an already-connected table is synced
  • A diagnosis flagged the incremental field or primary key as wrong
  • The table is syncing too often / not often enough
  • Switching an incremental table to CDC (or vice versa)
  • The source table was changed on the other side (new columns, dropped columns) and the sync config needs to catch up

If the user is setting up a brand-new source, use setting-up-a-data-warehouse-source instead — configuration is chosen at creation time there.

Available tools

Tool Purpose
external-data-schemas-retrieve Current sync_type, incremental_field, PKs, sync_frequency
external-data-schemas-incremental-fields-create Refresh candidate incremental fields from the live source
external-data-schemas-partial-update Apply the config change
external-data-schemas-reload Trigger a sync with the new config
external-data-schemas-resync Wipe and re-import from scratch when the change invalidates existing data
external-data-schemas-delete-data Drop the synced table while keeping the schema entry
external-data-sources-check-cdc-prerequisites-create Pre-flight Postgres CDC (only when switching to/from CDC)
external-data-sources-webhook-info-retrieve Current webhook state (when switching to/from sync_type=webhook)
external-data-sources-create-webhook-create Register a webhook after switching a schema to sync_type=webhook
external-data-sources-update-webhook-inputs-create Rotate a webhook signing secret
external-data-sources-delete-webhook-create Unregister webhook when switching schemas off sync_type=webhook

The fields you can tune

From the partial-update endpoint:

Field Values Notes
sync_type full_refresh, incremental, append, cdc, webhook Source must support the target type — check via incremental-fields
incremental_field Column name from the source Must appear in incremental_fields list for the schema
incremental_field_type datetime, date, timestamp, integer, numeric, objectid Must match the column's real type
primary_key_columns Array of column names Required for CDC. Used for upsert dedup on incremental
cdc_table_mode consolidated, cdc_only, both Only meaningful when sync_type=cdc
sync_frequency 5min, 15min, 30min, 1hour, 6hour, 12hour, 24hour, 7day, 30day, never How often the table syncs. CDC: how often changes load, 7day max
sync_time_of_day HH:MM:SS When sync_frequency is daily/weekly-scale
should_sync true / false
常见问题

修改同步设置会清除我的数据吗?

大多数更改是安全的,并会在下次同步时生效。少数更改需要谨慎处理,以免损坏已同步的数据。

我可以切换到变更数据捕获吗?

可以。这项技能涵盖增量同步与变更数据捕获(change data capture)同步模式之间的切换。

新数据源应该用这项技能吗?

不应该。新数据源的设置在创建时就已选定,所以应使用数据源设置技能。

详情

作者的原始描述

Change the sync configuration of an existing data warehouse schema — switch sync_type, pick a different incremental_field, set primary_key_columns, choose cdc_table_mode, or change sync_frequency. Use when the user asks "switch my orders table from full refresh to incremental", "this table is syncing too slowly / too frequently", "I need to pick a different incremental column", "set up CDC for this Postgres table", or when diagnosis of a failing sync pointed to an incremental-field or PK misconfiguration.

repo: PostHog/posthog

热度

GitHub 星标
41k
排名
#6971
许可证
—
更新时间
2026/11/2

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能