onOpen method

void onOpen(
  1. List<Future<dynamic Function(Database)>> fn
)

Executes when opening database. This method should be called before using eloquent.

DB.instance.onOpen([
      Future(() {
        return (Database db) async {};
      }),
  ]);

//Or
DB.instance.onOpen([UserEloquent.onOpen]);

Implementation

void onOpen(List<Future<Function(Database)>> fn) {
  _onOpen.addAll(fn);
}