openOrCreate static method
Open an existing table or create one if <basePath>.meta.json
is missing. The schema is only consulted when creating.
Implementation
static Future<PagedTable> openOrCreate(
String basePath, {
required List<PagedColumn> columns,
required String primaryKey,
int pageSize = 4096,
int cacheCapacity = 64,
}) async {
final meta = await _readMeta(basePath);
if (meta != null) {
final effectivePageSize = meta.pageSize ?? pageSize;
return _openWith(basePath, meta.columns, meta.pkIndex, meta.indexes,
pageSize: effectivePageSize, cacheCapacity: cacheCapacity);
}
return create(basePath,
columns: columns,
primaryKey: primaryKey,
pageSize: pageSize,
cacheCapacity: cacheCapacity);
}