/** * @copyright Sister Software * @license AGPL-3.0 * @author Teffen Ellis, et al. * * CSV → SQLite ingestion utility. Ported from isp-nexus's `sdk/data/csv.ts`. * * Reads a CSV file, infers column types from a sample of rows, creates a SQLite table, and imports * the data. Handles quoted fields, NULL normalization, and duplicate column name disambiguation. * * ## Usage * * ```sh * mailwoman corpus ingest-csv \ * --input /data/corpus/sources/usgov-nppes/npidata_pfile.csv \ * --table nppes_providers \ * --output /data/corpus/sources/usgov-nppes/nppes.db * ``` * * Options: --input CSV file to ingest (required) --table SQLite table name (default: * derived from input filename) --output SQLite database path (default: input dir / * table.db) --sample Rows to sample for type inference (default: 100) --separator * Field separator (default: ,) --skip Lines to skip before header (default: 0) --no-header * CSV has no header row — columns will be col_0, col_1, etc. --dry-run Infer schema and print * CREATE TABLE, but don't import */ /** * Flag-shaped options for {@linkcode ingestCSV} — `table`/`output` derive from `input` when omitted. */ export interface IngestCSVOptions { input: string; table?: string; output?: string; sample?: number; separator?: string; skip?: number; noHeader?: boolean; dryRun?: boolean; } /** * Ingest a CSV into SQLite: infer column types from a sample, create the table, import the rows. Throws when `input` is * missing. NOTE(phase1): progress narration still writes stderr directly — this predates the report-callback contract * and the write sites are deep in the type-inference helpers; thread a report param if a caller ever needs to capture * it. */ export declare function ingestCSV(options: IngestCSVOptions): Promise; //# sourceMappingURL=ingest-csv.d.ts.map