/** * @copyright Sister Software * @license AGPL-3.0 * @author Teffen Ellis, et al. * * CSV → SQLite ingest tool. * * The tool reads a CSV and samples rows to infer column types. * It creates a SQLite table and imports all rows. * It handles quoted fields, null-like values and duplicate column names. * * ## 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 Required CSV path * --table Table name (default: from filename) * --output DB path (default: input dir/.db) * --sample Rows used for type inference (default: 100) * --separator Field delimiter (default: ,) * --skip Lines to skip before header (default: 0) * --no-header Treat CSV as headerless (col_0, col_1, ...) * --dry-run Print inferred schema, skip import */ /** * Options for {@linkcode ingestCSV}. * `table` and `output` default from `input`. */ 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` does not exist. */ export declare function ingestCSV(options: IngestCSVOptions): Promise; //# sourceMappingURL=ingest-csv.d.ts.map