mirror of
https://github.com/lancedb/lancedb.git
synced 2026-01-03 10:22:56 +00:00
refactor: rename drop_db / drop_database to drop_all_tables, expose database from connection (#2098)
If we start supporting external catalogs then "drop database" may be misleading (and not possible). We should be more clear that this is a utility method to drop all tables. This is also a nice chance for some consistency cleanup as it was `drop_db` in rust, `drop_database` in python, and non-existent in typescript. This PR also adds a public accessor to get the database trait from a connection. BREAKING CHANGE: the `drop_database` / `drop_db` methods are now deprecated.
This commit is contained in:
@@ -499,6 +499,10 @@ def test_delete_table(tmp_db: lancedb.DBConnection):
|
||||
# if ignore_missing=True
|
||||
tmp_db.drop_table("does_not_exist", ignore_missing=True)
|
||||
|
||||
tmp_db.drop_all_tables()
|
||||
|
||||
assert tmp_db.table_names() == []
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_delete_table_async(tmp_db: lancedb.DBConnection):
|
||||
|
||||
Reference in New Issue
Block a user