API reference › @evolu/sqlite-wasm › SahPoolOptions
Defined in: packages/sqlite-wasm/src/SahPool.ts:444
Options for openSahPool.
Properties
directory
readonly directory: readonly [string & Brand<"OpfsName">, string & Brand<"OpfsName">];
Defined in: packages/sqlite-wasm/src/SahPool.ts:458
The pool directory, as the OpfsNames of the directories from the
OPFS root to it, such as [".evolu"]. Missing directories are created. The
names joined with / name the VFS, such as opfs-sahpool:.evolu, which no
other names get.
As in opfs-sahpool, one pool may use a directory at a time, across workers and wasm instances, so serialize opens of a directory, as Evolu does with its leader Web Lock. Otherwise, two openers of a new or empty directory can each create their own slots, and a file both create then exists twice: on the next open only one version shows, and the other is kept hidden and never reused.
heldTimeout?
readonly optional heldTimeout?: PositiveDuration;
Defined in: packages/sqlite-wasm/src/SahPool.ts:467
How long to keep trying to open the pool while another context holds a slot of it. The pool is opened again 50 ms after a held attempt, then after twice the previous delay, up to a second, and the open fails with SahPoolHeldError once an attempt ends at least this long after the first one started. Without it, a held slot fails the open at once.