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:
Ashis Kumar Naik
2023-08-12 09:29:56 +05:30
committed by GitHub
parent 2f2cb984d4
commit 902a402951
2 changed files with 52 additions and 0 deletions

View File

@@ -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)