DBObjectDirectoryAdapter constructor

DBObjectDirectoryAdapter(
  1. Directory directory, {
  2. bool generateTables = false,
  3. Object? populateTables,
  4. Object? populateSource,
  5. Object? populateSourceVariables,
  6. EntityRepositoryProvider? parentRepositoryProvider,
  7. String? workingPath,
  8. bool log = false,
})

Implementation

DBObjectDirectoryAdapter(
  this.directory, {
  super.generateTables,
  super.populateTables,
  super.populateSource,
  super.populateSourceVariables,
  super.parentRepositoryProvider,
  super.workingPath,
  super.log,
}) : super(
       'object.directory',
       1,
       3,
       const DBAdapterCapability(
         dialect: DBDialect('object'),
         transactions: true,
         transactionAbort: true,
         constraintSupport: false,
         multiIsolateSupport: true,
         connectivity: DBAdapterCapabilityConnectivity.none,
       ),
     ) {
  boot();

  if (!directory.existsSync()) {
    throw ArgumentError(
      "[DBObjectDirectoryAdapter]: Directory doesn't exists: $directory",
    );
  }

  var modeString = directory.statSync().modeString();
  if (!modeString.contains('rw')) {
    throw StateError(
      "[DBObjectDirectoryAdapter]: Can't read+write the directory: $directory",
    );
  }

  parentRepositoryProvider?.notifyKnownEntityRepositoryProvider(this);
}