* feat: add OpenBestAvailable to public API (#3143)
Adds OpenBestAvailable(ctx, beadsDir) which routes to the correct
storage backend based on metadata.json, mirroring the CLI's
newDoltStoreFromConfig logic:
- CGO builds: embedded mode (default) with exclusive flock, or server
mode when dolt_mode=server
- Non-CGO builds: server mode only, returns clear error for embedded
Returns (Storage, Unlocker, error) so callers manage the flock lifetime.
This fixes the problem where library users of OpenFromConfig silently
got an empty shadow database instead of the actual embedded store.
Amp-Thread-ID: https://ampcode.com/threads/T-019d736a-46a6-7178-91f3-854f36dd474b
Co-authored-by: Amp <amp@ampcode.com>
* test: add OpenBestAvailable tests from PR #3143
Restores test coverage that was dropped when PR #3149 reimplemented
the feature without carrying over the tests from bgjackma's original
PR #3143. Tests are adapted for the current (Storage, Unlocker, error)
return signature.
Co-authored-by: Brock Jackman <brockj@lyft.com>
---------
Co-authored-by: Amp <amp@ampcode.com>
Co-authored-by: Brock Jackman <brockj@lyft.com>