Expand description
Shared plumbing for the row-level transform commands (sample, shard).
Both commands follow the same pipeline: split the dump into per-table temp files, build a schema graph, walk each table’s data rows, spill selected rows to disk, then synthesize a single SQL output file. This module owns the pieces that were previously duplicated between the two commands:
UnifiedRow/RowFormat: dialect-agnostic row representationfor_each_data_row: the INSERT/COPY statement walkerRowSpillWriter/RowSpillReader: bounded-memory row spillingsplit_to_temp_tables/build_schema_graph: pipeline phases 0-1write_dialect_header/write_dialect_footer/quote_ident: session preamble and identifier quotingconvert_row_to_postgres/convert_copy_to_insert_values: output value conversion
Re-exports§
pub use crate::parser::RowFlow;
Structs§
- RowSpill
Reader - Reader for row spill files written by
RowSpillWriter. - RowSpill
Writer - Writer for spilling selected rows to a temp file with bounded memory.
- Split
Phase - Result of the phase-0 split into per-table temp files.
Enums§
- RowFormat
- Row format indicator for spilled/converted rows.
- Unified
Row - Combined row representation for both MySQL INSERT and PostgreSQL COPY.
Functions§
- build_
schema_ graph - Build a schema graph from a directory of split per-table files.
- convert_
copy_ to_ insert_ values - Convert PostgreSQL COPY format (tab-separated) to INSERT VALUES format.
- convert_
row_ to_ postgres - Convert a MySQL-style row to PostgreSQL syntax.
- for_
each_ data_ row - Walk every data row of a per-table SQL file, invoking
ffor each row. - is_
copy_ data_ block - Returns true if
stmtis a PostgreSQL COPY data block (ends with the\.terminator). - is_
numeric - Check if a byte slice represents a numeric value.
- quote_
ident - Quote an identifier for the given dialect.
- split_
to_ temp_ tables - Phase 0 shared by sample/shard: split the input dump into per-table temp files, with an optional byte-based progress bar.
- write_
dialect_ footer - Write the dialect-specific session footer (restores header settings).
- write_
dialect_ header - Write the dialect-specific session header (FK checks off, encoding, etc.).
- write_
insert_ chunk - Write a chunk of spilled rows as a single multi-row INSERT statement.