Add CSV import functionality

- Use csv crate for robust CSV parsing (handles quoted fields, empty values, \r\n)
- Extend --import command to auto-detect format by file extension (.csv or .json)
- Reuse existing ImportPipeline and analyzer for field type detection
- Categories detected automatically (string fields), measures for numeric fields
- Updated help text and welcome screen to mention CSV support

All 201 tests pass.
This commit is contained in:
Edward Langley
2026-04-01 01:32:19 -07:00
parent 2cf1123bcb
commit 23e26f0e06
6 changed files with 256 additions and 38 deletions

23
Cargo.lock generated
View File

@ -161,6 +161,27 @@ dependencies = [
"winapi",
]
[[package]]
name = "csv"
version = "1.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "52cd9d68cf7efc6ddfaaee42e7288d3a99d613d4b50f76ce9827ae0c6e14f938"
dependencies = [
"csv-core",
"itoa",
"ryu",
"serde_core",
]
[[package]]
name = "csv-core"
version = "0.1.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "704a3c26996a80471189265814dbc2c257598b96b8a7feae2d31ace646bb9782"
dependencies = [
"memchr",
]
[[package]]
name = "darling"
version = "0.23.0"
@ -374,6 +395,7 @@ dependencies = [
"anyhow",
"chrono",
"crossterm",
"csv",
"dirs",
"flate2",
"indexmap",
@ -381,6 +403,7 @@ dependencies = [
"ratatui",
"serde",
"serde_json",
"tempfile",
"thiserror",
"unicode-width 0.2.0",
]