Skip to content

database: open relative paths as local directories - #118

Open
vladwing wants to merge 1 commit into
facebookexperimental:mainfrom
vladwing:db-relative-path
Open

vladwing wants to merge 1 commit into
facebookexperimental:mainfrom
vladwing:db-relative-path

Conversation

@vladwing

Copy link
Copy Markdown
Contributor

semcode-index -d db/foo fails with "cannot connect to LanceDb Cloud unless the 'remote' feature is enabled". Any relative database path whose first component starts with "db" fails to open the same way, dbdata/x included. lancedb 0.27 sends every URI that starts with "db" to its cloud client, though only "db://" is meant for it.

DatabaseManager::new() now passes the path to lancedb through local_uri(), which prefixes "./" to a path that starts with "db" but not "db://". That names the same directory in a string that does not start with "db". Every other path passes unchanged, and "db://" behaves as before. local_uri() can go once semcode's lancedb dependency checks for "db://".

tests/relative_db_path.rs fails on main with the cloud error above and passes with this change. It opens a database by its relative path under a "db"-prefixed directory in the working directory, and creates the tables. Unit tests over a table of paths cover local_uri() itself.

`semcode-index -d db/foo` fails with "cannot connect to LanceDb Cloud
unless the 'remote' feature is enabled". Any relative database path
whose first component starts with "db" fails to open the same way,
`dbdata/x` included. lancedb 0.27 sends every URI that starts with "db"
to its cloud client, though only "db://" is meant for it.

`DatabaseManager::new()` now passes the path to lancedb through
`local_uri()`, which prefixes "./" to a path that starts with "db" but
not "db://". That names the same directory in a string that does not
start with "db". Every other path passes unchanged, and "db://" behaves
as before. `local_uri()` can go once semcode's lancedb dependency checks
for "db://".

`tests/relative_db_path.rs` fails on main with the cloud error above and
passes with this change. It opens a database by its relative path under
a "db"-prefixed directory in the working directory, and creates the
tables. Unit tests over a table of paths cover `local_uri()` itself.
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Nov 11, 2026
@vladwing vladwing closed this Nov 11, 2026
@vladwing vladwing reopened this Nov 11, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant