mirror of
https://github.com/lancedb/lancedb.git
synced 2026-01-10 13:52:58 +00:00
implementation of drop_database (#418)
#416 Fixed. added drop_database() method . This deletes all the tables from the database with a single command. --------- Signed-off-by: Ashis Kumar Naik <ashishami2002@gmail.com>
This commit is contained in:
@@ -193,6 +193,13 @@ class DBConnection(ABC):
|
||||
"""
|
||||
raise NotImplementedError
|
||||
|
||||
def drop_database(self):
|
||||
"""
|
||||
Drop database
|
||||
This is the same thing as dropping all the tables
|
||||
"""
|
||||
raise NotImplementedError
|
||||
|
||||
|
||||
class LanceDBConnection(DBConnection):
|
||||
"""
|
||||
@@ -334,3 +341,7 @@ class LanceDBConnection(DBConnection):
|
||||
except FileNotFoundError:
|
||||
if not ignore_missing:
|
||||
raise
|
||||
|
||||
def drop_database(self):
|
||||
filesystem, path = fs_from_uri(self.uri)
|
||||
filesystem.delete_dir(path)
|
||||
|
||||
Reference in New Issue
Block a user