kernl API
    Preparing search index...

    Function createSqliteOpfsCacheAdapter

    • An adapter for a cache in sqlite-wasm over the origin-private file system. sqlite runs in a dedicated worker on the SAH pool VFS, so the page needs no cross-origin isolation; sqlite-wasm is loaded only inside that worker. The database is checked with PRAGMA quick_check on open, and damage found then or later is repaired by wiping or rotating the file. A Web Lock keeps a second tab out; that tab falls back to the next adapter.

      Parameters

      • options: SqliteOpfsOptions = {}

        Filename, storage for the rotated filename, lock manager, connection and onRecover.

      Returns EventCacheAdapter

      The sqlite-opfs adapter. Its open rejects unavailable:opfs, unavailable:locked, unavailable:corrupt or unavailable:sqlite (…).

      import { createSqliteOpfsCacheAdapter, openEventCache } from '@kernlize/core/cache';

      const cache = await openEventCache([
      createSqliteOpfsCacheAdapter({ onRecover: ({ action, reason }) => console.warn(`event cache ${action}: ${reason}`) }),
      ]);