mix lightning.adaptors.import (Lightning v2.19.0)

View Source

Populate the adaptors table from a JSON file, without reaching npm.

The file is a JSON array of adaptor records in the shape Lightning.Adaptors.Catalogue.upsert_adaptor/1 accepts, the same shape mix lightning.adaptors.snapshot writes.

Usage

mix lightning.adaptors.import --path snapshot.json
mix lightning.adaptors.import --path snapshot.json --source local
mix lightning.adaptors.import --path snapshot.json --replace

--source defaults to npm. --replace deletes every existing row for that source first, so the file becomes the source's entire contents rather than a merge.

In a release

There is no Mix (or this task) in a release image. Seed from a snapshot before starting the app by running the equivalent through bin/lightning eval instead:

bin/lightning eval 'Lightning.Release.seed_adaptors("/path/to/snapshot.json", replace: true)'