Import Workflows
The CLI can import common local data formats into TaiDB. Imports are useful for building local search indexes, migrating small datasets, or preparing examples.
Import JSONL
Section titled “Import JSONL”Use JSON Lines when each line is an object. TaiDB infers keys and values from the importer implementation.
taidb import ./app.taidb ./data.jsonl --format jsonlAdd a key prefix:
taidb import ./app.taidb ./data.jsonl --format jsonl --prefix docs:Import CSV
Section titled “Import CSV”taidb import ./app.taidb ./data.csv --format csvUse a batch size that fits your memory and durability requirements:
taidb import ./app.taidb ./data.csv --format csv --batch-size 8192Import a directory
Section titled “Import a directory”Directory import is useful for local document indexes.
taidb import ./docs.taidb ./notes --format dir --prefix file:Auto-detect format
Section titled “Auto-detect format”taidb import ./app.taidb ./data.jsonl --format autoAuto-detection is convenient, but explicit formats are better in scripts.
Import from another TaiDB database
Section titled “Import from another TaiDB database”taidb import-db ./target.taidb ./source.taidb --prefix old:If the source database is encrypted:
taidb import-db ./target.taidb ./source.taidb \ --source-key-file ./source.key \ --prefix migrated:Verify after import
Section titled “Verify after import”taidb stats ./app.taidb --jsontaidb verify ./app.taidbFor larger imports, record:
- source file count or row count
- batch size
- compression settings
- encryption settings
- total import time
- final
stats --jsonoutput
This makes import performance easier to compare across releases.