initialize method

Future<void> initialize(
  1. DatabaseSession session
)

Initializes shared schema rows and caches their generated identifiers.

Implementation

Future<void> initialize(DatabaseSession session) async {
  if (_schema != null) return;

  final schemaFuture = _schemaFuture ??= _loadSchema(session);
  try {
    _schema = await schemaFuture;
  } catch (_) {
    if (identical(_schemaFuture, schemaFuture)) {
      _schemaFuture = null;
    }
    rethrow;
  }
}