SeedRecorder class

Runs seeders, records what they change, and puts it back.

seed in metro live and Seeder.seed use it. While a seeder's up() runs, NyStorage and Backpack report each change to a recording held in the current zone. The record of every seeded seeder is kept in storage under recordKey, so it survives hot restarts.

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Properties

registry → Map<String, Seeder Function()>
The seeders registered on the running Nylo instance.
no setter

Static Methods

downAll(List<Seeder> seeders) → Future<List<SeedRun>>
Runs each seeder's down(), last seeder first, stopping at the first failure.
forgetBackpackValues() → void
Forgets the Backpack values kept in memory, as a restart would.
list() → Future<List<Map<String, Object?>>>
Each registered seeder's name, description and when it was last seeded, followed by seeders that are still recorded but no longer registered.
nameFromClass(String className) → String
DemoUserSeeder, DemoUser and demo-user all become demo_user.
nameOf(Seeder seeder) → String
The name seeder runs by: its key in the registered seeders, otherwise its own Seeder.name, otherwise its class name in snake case without Seeder (DemoUserSeeder is demo_user).
restore(Seeder seeder) → Future<void>
Puts back everything seeder changed when it was seeded.
runNamed(List<String> names, {required String direction, bool fresh = false}) → Future<List<SeedRun>>
Runs the seeders named names in direction: up or down.
seedChildren(List<Seeder> seeders) → Future<void>
Runs seeders from inside another seeder's up(), each recorded as its own run. Throws when one fails, so the parent fails too.
upAll(List<Seeder> seeders, {bool fresh = false}) → Future<List<SeedRun>>
Runs each seeder's up() in order, stopping at the first failure.

Constants

recordKey → const String
The storage key the record of seeded seeders is kept under.