Skip to content

Commit e90cf2f

Browse files
author
amar-python
committed
Consolidate README documentation
1 parent 10435bf commit e90cf2f

11 files changed

Lines changed: 51 additions & 506 deletions

File tree

README.md

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,7 @@ PostgreDataMigrationApp/
9797
│ ├── variables.tf
9898
│ ├── outputs.tf
9999
│ ├── terraform.tfvars.example
100-
│ ├── .gitignore
101-
│ └── README.md
100+
│ └── .gitignore
102101
103102
├── setup.sh ← Interactive multi-database configuration wizard
104103
├── deploy_all.sh ← Multi-engine deployment router
@@ -206,6 +205,30 @@ ORDER BY r.req_identifier;
206205

207206
---
208207

208+
## CSV Loader
209+
210+
`csv_loader.sh` validates CSV files, derives the target table name from the filename unless `--table` is supplied, writes accepted/skipped row outputs under `csv/logs/`, and routes valid rows to the selected engine-specific loader.
211+
212+
```bash
213+
# Load into the engine from config.local.env
214+
./csv_loader.sh data/customers.csv
215+
216+
# Specify engine/environment
217+
./csv_loader.sh data/orders.csv --engine postgresql --env dev
218+
219+
# Validate only
220+
./csv_loader.sh data/products.csv --engine sqlite --dry-run
221+
222+
# Override the target table name
223+
./csv_loader.sh data/export_2025.csv --engine mariadb --table invoices
224+
```
225+
226+
CSV inputs must have a header row, use comma delimiters, and be UTF-8 encoded with or without a BOM. The shared Python validator skips empty rows and row/header column-count mismatches, warns on duplicate headers, preserves quoted commas/newlines, and writes rejected rows with an `_skip_reason` column.
227+
228+
Supported loader backends are PostgreSQL, MariaDB/MySQL, SQLite, InfluxDB, Redis, and Teradata. PostgreSQL uses `COPY`, MariaDB/MySQL uses `LOAD DATA LOCAL INFILE`, SQLite uses Python `csv` + `sqlite3`, InfluxDB writes line protocol via the `influx` CLI, Redis writes hashes through `redis-cli`, and Teradata uses BTEQ/FastLoad tooling.
229+
230+
---
231+
209232
## How Parameterisation Works
210233

211234
Every environment file contains **only a `\set` configuration block** followed by `\i te_core_schema.sql`. All logic lives in the core schema — the environment file is pure configuration.

csv/README.md

Lines changed: 0 additions & 204 deletions
This file was deleted.

evals/HANDOFF.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@
99
|--------------|-----------|
1010
| `evals/PLAN.md` | Scope, folder layout, tiering, phases |
1111
| `evals/FAILURE_MODES.md` | 29 catalogued failure modes; all 22 Tier P modes now covered |
12-
| `evals/README.md` | How to run; CLI flags; exit codes |
12+
| root `README.md` + `evals/USAGE.md` | How to run; CLI flags; exit codes |
1313
| `evals/runner.py` | Single-file scenario discovery + diff engine + JSON report writer (606 lines) |
1414
| `evals/datasets/tier_p/01-23/` | 23 CSV scenarios (happy + empty + malformed + unicode + generated edge cases) |
15-
| `evals/datasets/tier_i/01_deploy_dev_twice/` | Idempotency scenario (README only runner drives the work) |
15+
| `evals/datasets/tier_i/01_deploy_dev_twice/` | Idempotency scenario (NOTES only; runner drives the work) |
1616
| `evals/datasets/tier_s/01_fresh_deploy_then_all_tests_pass/` | SQL-suite integration scenario |
17-
| `evals/expected/tier_p/*.json` | 20 expected-outcome files |
17+
| `evals/expected/tier_p/*.json` | 23 expected-outcome files |
1818
| `evals/expected/tier_i/01_deploy_dev_twice.json` | Expected outcome (exit codes + row-count parity) |
1919
| `evals/expected/tier_s/01_fresh_deploy_then_all_tests_pass.json` | Expected outcome (85/85 + ALL TESTS PASSED) |
2020
| `evals/reports/` | Auto-created at runtime; one folder per run with `summary.json` |
@@ -38,7 +38,7 @@ cd "$env:USERPROFILE\OneDrive\Desktop\Migration using ai\PostgreDataMigrationApp
3838
python evals\runner.py
3939
```
4040

41-
Expect: `total: 20, passed: 20, failed: 0, skipped: 0` and exit code 0.
41+
Expect: `total: 23, passed: 23, failed: 0, skipped: 0` and exit code 0.
4242

4343
### 2. Run Tier I + S against your local PostgreSQL
4444

@@ -107,11 +107,11 @@ Catalogued in `FAILURE_MODES.md` so they're not lost.
107107

108108
| Category | Count |
109109
|----------|-------|
110-
| Markdown docs (PLAN, FAILURE_MODES, README, HANDOFF) | 4 |
110+
| Markdown docs (root README, PLAN, FAILURE_MODES, USAGE, HANDOFF) | 5 |
111111
| Python (`runner.py`) | 1 |
112112
| CSV input fixtures | 20 (scenarios 19, 20, 22, and 23 are generated/no-input scenarios) |
113113
| Expected JSON files | 25 |
114-
| Scenario README/TXT files | 4 |
114+
| Scenario note/TXT files | 4 |
115115
| **Total files created** | **55** |
116116

117117
## Open items

evals/PLAN.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ PostgreDataMigrationApp/
3434
└── evals/
3535
├── PLAN.md ← this file
3636
├── FAILURE_MODES.md ← failure-mode catalogue
37-
├── README.md ← how to run it
3837
├── runner.py ← scenario discovery + diff engine + report
3938
4039
├── datasets/
@@ -46,11 +45,11 @@ PostgreDataMigrationApp/
4645
│ │
4746
│ ├── tier_i/ ← idempotency scenarios
4847
│ │ └── 01_deploy_dev_twice/
49-
│ │ └── README.md ← what the runner does (no CSV needed)
48+
│ │ └── NOTES.txt ← what the runner does (no CSV needed)
5049
│ │
5150
│ └── tier_s/ ← SQL suite integration
5251
│ └── 01_fresh_deploy_then_all_tests_pass/
53-
│ └── README.md
52+
│ └── NOTES.txt
5453
5554
├── expected/
5655
│ ├── tier_p/
@@ -112,7 +111,7 @@ Exit code: 0 if all scenarios in selected tiers pass, 1 otherwise. CI-friendly.
112111

113112
| Phase | What | Status |
114113
|-------|------|--------|
115-
| 0 | This PLAN + FAILURE_MODES + README | **DONE** |
114+
| 0 | PLAN + FAILURE_MODES + root README coverage | **DONE** |
116115
| 1 | Tier P dataset folders (23 scenarios) + expected JSONs | DONE |
117116
| 2 | Tier P runner.py | DONE |
118117
| 3 | Execute Tier P locally; show results | DONE / awaiting your review |

0 commit comments

Comments
 (0)