feat: add standalone binlog-to-page correlation API#203
Conversation
Add `correlate_events()` in new `src/binlog/correlate.rs` module that maps binlog row events to tablespace pages via B+Tree PK lookup. Refactor `timeline.rs` to reuse shared helpers, add WASM export. Closes #178
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Code reviewFound 1 issue:
idb-utils/src/binlog/correlate.rs Lines 37 to 49 in 420352c idb-utils/src/binlog/correlate.rs Lines 157 to 160 in 420352c CLAUDE.md reference: https://github.com/ringo380/idb-utils/blob/420352cb081ae8f04e75424f90e73da968bc1adf/CLAUDE.md#L167 |
- Replace bare numeric event type codes (19, 30, 31, 32) with named constants from binlog/constants.rs (TABLE_MAP_EVENT, WRITE_ROWS_EVENT, UPDATE_ROWS_EVENT, DELETE_ROWS_EVENT) - Fix build_column_meta to match PK columns by name against DDL-ordered column names instead of assuming PK columns are first in TABLE_MAP order (TABLE_MAP uses DDL order, not InnoDB's PK-first physical order) - Add extract_ddl_column_names helper to read DDL-ordered column names from tablespace SDI metadata - Use public re-export path in WASM binding
e9e479d to
b6acfb5
Compare
Summary
correlate_events()API in newsrc/binlog/correlate.rs— maps binlog row events (INSERT/UPDATE/DELETE) to tablespace pages via B+Tree PK lookuptimeline.rs::correlate_binlog_pages()to use shared helpers (build_column_meta,convert_pk_values), eliminating ~50 lines of duplicationcorrelate_binlog_events()WASM export for web UI consumptionCloses #178
New API
CorrelatedEventincludes:binlog_pos,event_type(Insert/Update/Delete),database,table,page_no,space_id,page_lsn,pk_values,timestamp.Test plan
RowEventType,convert_pk_values,build_column_metacorrelate_eventsreturns empty vec for tablespace without SDIcargo clippy -- -D warnings— zero warningscargo check --target wasm32-unknown-unknown --no-default-features— WASM compiles