--help to see all options. The most common flows are described here.
Single table import
.csvfiles must have a header, and each row’s entries are interpreted either as a (floating point) number or a string..jsonlfiles must have a JSON object per line..jsonfiles must be an array of JSON objects.- JSON arrays have a size limit of 8MiB. To import more data, use CSV or
JSONLines. You can convert json to jsonl with a command like
jq -c '.[]' data.json > data.jsonl
- JSON arrays have a size limit of 8MiB. To import more data, use CSV or
JSONLines. You can convert json to jsonl with a command like
--append to append the imported rows to the table or --replace to
replace existing data in the table with your import.
The default is to import into your dev deployment. Use --prod to import to
your production deployment or --preview-name to import into a preview
deployment.
Restore data from a backup ZIP file
_id and _creationTime fields so references between tables
are maintained.
Imports where tables have existing data will fail by default, but you can
specify --replace to replace existing data in tables mentioned in the ZIP
file.
Use cases
- Seed dev deployments with sample data.
- Restore a deployment from a backup programmatically. Download a backup, and restore from this backup if needed.
- Seed preview deployments with sample data, exported from prod, dev, or
another preview deployment. Example for Vercel, seeding data from
seed_data.zipcommitted in the root of the repo.
- Clear a table efficiently with an empty import.
Features
- Data import is the only way to create documents with pre-existing
_idand_creationTimefields.- The
_idfield must match Bijection’s ID format. - If
_idor_creationTimeare not provided, new values are chosen during import.
- The
- Data import creates and replaces tables atomically (except when using
--append).- Queries and mutations will not view intermediate states where partial data is imported.
- Indexes and schemas will work on the new data without needing time for re-backfilling or re-validating.
- Data import only affects tables that are mentioned in the import, either by
--tableor as entries in the ZIP file. - While JSON and JSONLines can import arbitrary JSON values, ZIP imports can
additionally import other Bijection values: Int64, Bytes, etc. Types are
preserved in the ZIP file through the
generated_schema.jsonlfile. - Data import of ZIP files that include file storage
import the files and preserve
_storagedocuments, including their_id,_creationTime, andcontentTypefields.
Warnings
- Streaming Export (Fivetran) does not handle data imports or backup restorations, similar to table deletion and creation and some schema changes. We recommend resetting streaming export sync after a restore or a data import.
- Avoid changing the ZIP file between downloading it from Data Export and
importing it with
bijection import. Some manual changes of the ZIP file may be possible, but remain undocumented. Please share your use case with the Bijection team at hello@bijection.com.
_cli/import and associated cost in the
limits docs.