Files
turso/sync
Pekka Enberg af01b39469 core: replace bypass-registry opens with do_open/do_open_async
The bypass-registry open variants existed so a few callers could open a
second Database instance for one file (the sync engine's revert WAL, a
wal-copy test) without the process-wide registry handing back the canonical
instance. Model that directly instead of as a bypass flag: add
Database::do_open_async (and the conn_raw_api-gated sync do_open) that never
consult the registry and are the only entry points that honor
OpenOptions::wal_path.

The registry-aware open/open_async reject wal_path with InvalidArgument,
because the registry keys on the default WAL for a path; a registered
instance reading a nonstandard WAL would be handed to a later plain open of
the same path. open_async now inlines the registry lookup/register logic and
funnels the actual open, along with the raw path, through one internal
worker that releases the schema guard on failure.

Convert the two callers (sync-engine revert-db open, wal-copy test) and
delete open_with_flags_bypass_registry and
open_with_flags_bypass_registry_async.

Tests: open() rejects wal_path; do_open opens a distinct instance and does
not register itself over the canonical one. cargo test -p turso_core;
turso_sync_engine --lib; core_tester wal_api/database; clippy --workspace
--all-features --all-targets clean
2026-07-19 11:11:06 +03:00
..
2026-07-07 09:23:33 -07:00