open static method

Future<PagedTable> open(
  1. String basePath, {
  2. int pageSize = 4096,
  3. int cacheCapacity = 64,
})

Open an existing paged table from <basePath>.meta.json. Throws if the metadata file does not exist. When the metadata records a pageSize, it overrides the pageSize argument (the on-disk page size is authoritative — changing it after the table exists would corrupt every page boundary).

Implementation

static Future<PagedTable> open(
  String basePath, {
  int pageSize = 4096,
  int cacheCapacity = 64,
}) async {
  final meta = await _readMeta(basePath);
  if (meta == null) {
    throw StateError('PagedTable: no metadata at $basePath.meta.json');
  }
  final effectivePageSize = meta.pageSize ?? pageSize;
  return _openWith(basePath, meta.columns, meta.pkIndex, meta.indexes,
      pageSize: effectivePageSize, cacheCapacity: cacheCapacity);
}