Seeder class abstract

Base class for database seeders.

Subclasses implement run to populate the database with initial or dummy data.

class UserSeeder extends Seeder {
  @override
  Future<void> run(DatabaseAdapter db) async {
    await db.table('users').insert({
      'email': 'admin@example.com',
      'name': 'Admin User',
    });
  }
}

Constructors

Seeder()
Internal constructor for Seeder.

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
run(DatabaseAdapter db) → Future<void>
Executes database seed operations using the given db adapter.
toString() → String
A string representation of this object.
inherited

Operators

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