{"id":69131,"plugin_id":"plugin_asdk_app_6ae160c3d9e48191aaeffd03cc5ef09d","kind":"skill","collection_source":"plugin_package","comparison_source":null,"observed_at":"2026-10-28T18:07:03.923Z","digest":"d000f5dce32cb034ead9e6225a37141046a5170e1392e7e497e70db84a2d204c","against":null,"payload":{"description":"Guide for using molt verify to compare source and target databases for schema and row-level consistency after a migration. Use when running verify commands, tuning concurrency/sharding, handling schema mismatches, or validating data integrity post-migration.","included_files":[{"relative_path":"references/flags.md","size_in_bytes":2185}],"name":"molt-verify","skill_md_contents":"---\nname: molt-verify\ndescription: Guide for using molt verify to compare source and target databases for schema and row-level consistency after a migration. Use when running verify commands, tuning concurrency/sharding, handling schema mismatches, or validating data integrity post-migration.\ncompatibility: Requires molt binary. Source and target DBs must be accessible. Oracle requires CGO build.\n---\n\n# molt verify\n\nCompares source and target databases for schema (DDL) and row (data) consistency. Run after `molt fetch` to confirm migration integrity.\n\n## Basic Structure\n\n```bash\nmolt verify \\\n  --source \"<source-conn>\" \\\n  --target \"<crdb-conn>\" \\\n  [options]\n```\n\n## Verification Phases\n\n**Phase 1 — Schema:** Compares table presence, columns, types, NOT NULL constraints, and primary key structure.\n\n**Phase 2 — Rows** (default, `--rows=true`): Iterates source rows in PK order and compares against target. Reports missing, extraneous, and mismatched rows per shard.\n\n## Modes\n\n| Mode | Command | Use When |\n|------|---------|----------|\n| Full (default) | `molt verify --source \"...\" --target \"...\"` | Post-migration integrity check |\n| Schema-only | `molt verify ... --rows=false` | Fast DDL check; no data I/O |\n\n## Concurrency & Sharding\n\n```bash\n# Default: CPU-count tables in parallel, 1 shard/table, 20k rows/batch\nmolt verify --source \"...\" --target \"...\"\n\n# Large tables: parallelize within a single table\nmolt verify --source \"...\" --target \"...\" \\\n  --concurrency 1 --concurrency-per-table 8 --row-batch-size 50000\n\n# Rate-limited (minimize production impact)\nmolt verify --source \"...\" --target \"...\" \\\n  --rows-per-second 1000 --concurrency 2\n```\n\nSharding splits a table's PK range across workers. Supported PK types: INT, FLOAT, DECIMAL, UUID. Falls back to a single full-scan for unsupported types.\n\n## Common Workflows\n\n### 1. Post-migration sanity check\n```bash\nmolt verify \\\n  --source \"postgresql://<user>:<password>@pg:5432/db\" \\\n  --target \"postgresql://root@crdb:26257/db\"\n```\n\n### 2. Schema-only (CI gate)\n```bash\nmolt verify \\\n  --source \"...\" --target \"...\" \\\n  --rows=false --non-interactive --log-file stdout\n```\n\n### 3. Filtered verification (subset of tables)\n```bash\nmolt verify \\\n  --source \"...\" --target \"...\" \\\n  --table-filter \"customers|orders\"\n```\n\n### 4. Verify with column exclusions\n```bash\n# transformations.json: {\"tables\":[{\"name\":\"users\",\"excludedColumns\":[\"temp_col\"]}]}\nmolt verify \\\n  --source \"...\" --target \"...\" \\\n  --transformations-file transformations.json\n```\n\n## Source-Specific Prerequisites\n\n**PostgreSQL**: No special requirements. Partition tables (child partitions) are not supported — remove them before verifying.\n\n**MySQL**: Queries current database only. `ONLY_FULL_GROUP_BY` may affect queries; disable if issues arise.\n\n**Oracle**: Binary must be built with `CGO_ENABLED=1 -tags=\"cgo source_all\"`. Oracle Instant Client in `LD_LIBRARY_PATH`. Use `--source-cdb` for multi-tenant (CDB) setups. Selective data verification (`--filter-path`) is not supported.\n\n## Output & Reporting\n\nEach table prints a summary per shard:\n```\ntruth rows seen: 10000, success: 9950, missing: 5, mismatch: 45, extraneous: 0\n```\n\n- **missing**: rows present on source but absent on target\n- **extraneous**: rows on target with no match on source\n- **mismatch**: rows present on both but values differ\n\nSchema issues (missing/extra tables or columns, type mismatches, PK differences) are logged as warnings and do not stop row verification.\n\nPrometheus metrics available at `--metrics-listen-addr` (default `127.0.0.1:3030`).\n\n## Error Recovery\n\n| Error | Cause | Fix |\n|-------|-------|-----|\n| `missing table X on target` | Table not migrated | Rerun fetch or check filters |\n| `extraneous table X on target` | Unexpected table | Clean up or adjust `--table-filter` |\n| `column type mismatch` | Type conversion issue | Check type mappings or use `--transformations-file` |\n| `PRIMARY KEY does not match` | PK structure differs | Inspect schema conversion output |\n| `partition table X` | Source has partition tables | Drop/move partitions before verifying |\n| `missing a PRIMARY KEY` | No PK on source table | Add PK or use `--rows=false` |\n| `TLSModeDisableError` | Insecure connection rejected | Add `--allow-tls-mode-disable` |\n| Statement timeout | Query exceeds `--verify-statement-timeout` | Increase timeout or reduce `--row-batch-size` |\n\n## Gotchas\n\n- Schema changes between source and target after migration are not automatically reconciled — fix schema first, then re-run\n- `--concurrency` values exceeding 4× CPU count trigger a warning and may degrade performance\n- Row verification requires primary keys on both source and target tables; tables without PKs are skipped for row comparison\n- `--filter-path` (selective row filters) is not supported for Oracle sources\n- Log files contain sensitive query data; avoid `--show-connection-logging` in production logs\n- After fetch, always run verify before cutover to confirm data integrity\n\nSee [flags reference](references/flags.md) for the full flag list.\n"},"changes":[],"summary":"First saved snapshot. No earlier version is available for comparison.","summary_kind":"deterministic","summary_metadata":{}}