Skip to content

依赖迁移跟踪:rusqlite 0.40 与 toml 1.0/toml_edit 0.25(#90 拆批遗留) #104

Description

@BigStrongSun

背景

PR #90(dependabot 58 项 Rust 依赖批量升级)合入时混入 3 项无代码迁移配套的破坏性 major 升级,v3.20.2-20 按 #14 拆批先例回退了其中 3 项(提交 ecd6ce2,详见 #90 留言)。本 issue 跟踪迁移与重新合入。

子任务

1. rusqlite 0.31 → 0.40

  • 0.40 移除了 u64/usize 的 ToSql/FromSql impl(0.31 为 fallible 转换,溢出报错)。
  • 约 30 处数据库读写边界(codex_paginated_history_repair/migration_recovery、database/dao/providers、dao/failover、database/migration、codex_multirouter/migration 等)需要 u64 → i64 语义改造。
  • 注意:SQLite 整型即 i64,结构体字段(offset/ordinal/rowid)的 u64 类型是否也应一并改 i64,需在迁移时统一口径;不得用裸 as i64 静默回绕。

2. toml 0.8 → 1.0 / toml_edit 0.22 → 0.25

  • toml 1.0 的 Value: FromStr 不再解析 TOML 文档、只解析单个 value;27 处 .parse::<toml::Value>() 文档解析点需改为 toml::from_str 或 Document API。
  • toml_edit 0.25 的序列化/格式行为需对照既有"字节一致"契约验证(strip_mcp 字节一致测试、multirouter digest、config 投影等),确认无格式漂移后再升级。
  • 上游 farion1231/cc-switch 目前仍在 0.8/0.22/0.31,无迁移先例可参考。

验收

  • 每项升级单独提交 + 全量 cargo test --lib -- --test-threads=1 通过(0 failed)。
  • toml 相关需额外验证 config.toml 投影/回写的字节一致性与 digest 稳定性。
  • 上游若先完成迁移,优先对齐上游实现。

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions