Skip to main content

irodori_migration/
lib.rs

1//! Database migration planning, schema diff, verification SQL, and tabular IO.
2//!
3//! This crate is intentionally execution-free by default: it builds plans,
4//! SQL, scripts, manifests, and import/export streams, while host
5//! applications own credentials, network access, scheduling, and approval UX.
6
7#![forbid(unsafe_code)]
8
9pub mod canonical;
10pub mod checksum;
11pub mod dialect;
12pub mod export;
13pub mod io;
14pub mod plan;
15pub mod recipe;
16pub mod rollout;
17pub mod schema;
18mod sql_ref;
19
20pub use canonical::{
21    canonical_cell_sql, canonical_row_sql, canonical_value_sql, canonicalization_warnings,
22    CanonicalColumn, CanonicalType, CanonicalizationPolicy, TimestampMode,
23};
24pub use checksum::{
25    build_sync_repair_plan, checksum_diff_sql, checksum_manifest_table_sql,
26    chunk_checksum_select_sql, pt_table_checksum_model, AdaptiveChunking, ChecksumAggregate,
27    ChecksumFunction, ChunkBounds, ChunkChecksumConfig, SyncAlgorithm, SyncRepairAction,
28    SyncRepairPlan, SyncRepairTemplate,
29};
30pub use export::{export_rows, ExportConfig, ExportControl, ExportReport};
31pub use io::{
32    generate_inserts_from_csv, infer_csv_schema, preview_delimited, preview_json, preview_ndjson,
33    Cell, ColumnMapping, DelimitedEncoder, DelimitedImportOptions, DelimitedOptions, ImportColumn,
34    ImportPreview, ImportPreviewOptions, InferredColumn, InferredType, JsonEncoder, NdjsonEncoder,
35    OwnedCell, QuoteStyle, SqlColumnSpec, SqlInsertEncoder, SqlScriptEncoder, SqlScriptOptions,
36    SqlWriteMode, TabularEncoder, UpsertStyle,
37};
38pub use plan::{
39    build_migration_plan, build_migration_snippets, checkpoint_mark_completed_sql,
40    checkpoint_resume_sql, checkpoint_table_sql, chunk_iteration_sql, chunk_manifest_table_sql,
41    failed_bucket_row_diff_sql, fingerprint_sql, foreign_key_integrity_sql, foreign_key_load_order,
42    hash_bucket_diff_sql, hash_bucket_fingerprint_sql, key_hash_expression, key_hash_profile_sql,
43    keyed_diff_sql, manifest_table_sql, map_column_type, parse_column_list,
44    partition_fingerprint_sql, row_hash_expression, row_hash_select_sql, target_table_ddl_sql,
45    try_build_migration_plan, vscode_snippet_body, ChunkIterationConfig, ColumnTypeMapping,
46    ForeignKeyLoadOrder, ForeignKeySpec, MigrationCheckpointConfig, MigrationEngine,
47    MigrationExportFormat, MigrationPlan, MigrationPlanError, MigrationPlanIssue, MigrationSnippet,
48    MigrationSnippetKind, MigrationSnippetVariable, MigrationSpec, MigrationTask,
49    MigrationTaskLevel, SourceColumnSpec,
50};
51pub use recipe::{
52    dry_run_text_recipe, recipe_run_summary, MigrationRecipe, RecipePhase, RecipePreview,
53};
54pub use rollout::{
55    attach_validation_gates, expand_contract_rollout, shadow_read_runbook,
56    validation_rollout_gates, MigrationValidationSummary, RolloutGate, RolloutPhase, RolloutPlan,
57    RolloutStep, ShadowReadExperiment,
58};
59pub use schema::{
60    diff_schemas, AlterColumnStyle, AlteredColumn, AlteredTable, CheckConstraint, Column,
61    ColumnChange, ForeignKeyConstraint, Index, MigrationScript, MigrationStatement,
62    PrimaryKeyChange, Rename, RenameHint, Schema, SchemaDiff, Table, TableConstraint,
63    UniqueConstraint, UnsupportedMigration,
64};
65pub use sql_ref::{TableRef, TableRefParseError};
66
67#[cfg(feature = "avro")]
68pub use io::AvroEncoder;
69
70#[cfg(feature = "parquet")]
71pub use io::ParquetEncoder;