Interface DataImportOptions

Options for data import.

interface DataImportOptions {
    dropTables?: boolean;
    skipSchema?: boolean;
    skipData?: boolean;
    batchSize?: number;
    tables?: string[];
    onConflict?: "replace" | "error" | "ignore";
    sourceDialect?: "sqlite" | "postgres";
    columnTypes?: Record<string, string>;
}

Properties

dropTables?: boolean

Drop existing tables before import

skipSchema?: boolean

Skip schema creation (data only)

skipData?: boolean

Skip data import (schema only)

batchSize?: number

Batch size for inserts

tables?: string[]

Tables to import (all if not specified)

onConflict?: "replace" | "error" | "ignore"

On conflict strategy

sourceDialect?: "sqlite" | "postgres"

The engine the data came from, for an export that does not say (ExportedData.dialect is newer than some exports). Without either, the schema's types and defaults are read as the target engine's.

columnTypes?: Record<string, string>

Column types to create as given, by table.column: { 'events.at_ms': 'BIGINT' }.