Misaka_Company ea48de290f fix(sync): track cleanup state to stop re-deleting log rows and bound SyncQueue
- access_reader.delete_log_ids returns the actual rows deleted (was None).

- sql_writer.mark_cleaned flips applied queue rows to 'cleaned' (sets CleanedAt) after their Access log rows are physically removed, so the same IDs are never deleted twice.

- sql_writer.purge_cleaned removes 'cleaned' rows older than a retention window (default 24h) so SyncQueue stops growing without bound.

- cleanup.cleanup_file marks rows cleaned after a successful delete and returns the real delete count, so the service log reports honest 'cleaned N' instead of a constant.

- service.cycle calls purge_cleaned once per pass; config adds cleaned_retention_hours (default 24).

- sql/01_sync_queue.sql adds CleanedAt column + IX_SyncQueue_Cleaned idempotently.

- tests: unit coverage for mark_cleaned/purge_cleaned/delete_log_ids return count; assert cycle purges each pass.
2026-07-14 16:32:47 +08:00

ProductionDataBaseSync_DataMacro

Access → SQL Server 增量同步(数据宏驱动)。详见 docs/superpowers/specs/2026-07-14-access-datamacro-sync-design.md

运行

.venv/Scripts/python.exe -m sync.service

配置

编辑 config.yaml(从 config.example.yaml 复制并填入真实凭据)。

Description
Access to SQL Server incremental sync, data-macro driven
Readme 209 KiB
Languages
Python 83.8%
TSQL 16.1%
Batchfile 0.1%