import { connect, Resources, Process } from "@truffle/db";
const db = connect({
// ...
});
const { Run, resources } = Process;
const { run } = Run.forDb(db);
const sources: (
| Resources.IdObject<"sources">
| null
)[] = await run(resources.load, "sources", [
{ sourcePath: "...", contents: "..." }
]);
Generated using TypeDoc
resources.loadLoads resource inputs and processes into corresponding [[IdObject | IdObjects]].
The resulting array will always have the same length as the inputs, with each result corresponding to the input at the same index. Invalid inputs correspond to
nullresource results.Note: This function returns a generator. For
asyncbehavior, use with a [[Meta.Process.ProcessorRunner | ProcessorRunner]] such as that returned by [[Run.forDb]] or [[Project.run]].