openSync static method

Isar openSync(
  1. List<CollectionSchema> schemas, {
  2. required String directory,
  3. String name = defaultName,
  4. int maxSizeMiB = Isar.defaultMaxSizeMiB,
  5. bool relaxedDurability = true,
  6. CompactCondition? compactOnLaunch,
  7. bool inspector = true,
})

Open a new Isar instance.

Implementation

static Isar openSync(
  List<CollectionSchema<dynamic>> schemas, {
  required String directory,
  String name = defaultName,
  int maxSizeMiB = Isar.defaultMaxSizeMiB,
  bool relaxedDurability = true,
  CompactCondition? compactOnLaunch,
  bool inspector = true,
}) {
  _checkOpen(name, schemas);

  /// Tree shake the inspector for profile and release builds.
  assert(() {
    if (!_kIsWeb && inspector) {
      _IsarConnect.initialize(schemas);
    }
    return true;
  }());

  return openIsarSync(
    schemas: schemas,
    directory: directory,
    name: name,
    maxSizeMiB: maxSizeMiB,
    relaxedDurability: relaxedDurability,
    compactOnLaunch: compactOnLaunch,
  );
}