diff --git a/funlib/persistence/graphs/pgsql_graph_database.py b/funlib/persistence/graphs/pgsql_graph_database.py index e688c3f..e2cc832 100644 --- a/funlib/persistence/graphs/pgsql_graph_database.py +++ b/funlib/persistence/graphs/pgsql_graph_database.py @@ -75,6 +75,11 @@ def __init__( edge_attrs=edge_attrs, # type: ignore ) + def _drop_edges(self) -> None: + logger.info("dropping edges table %s", self.edges_table_name) + self.__exec(f"DROP TABLE IF EXISTS {self.edges_table_name}") + self._commit() + def _drop_tables(self) -> None: logger.info( "dropping tables %s, %s", diff --git a/funlib/persistence/graphs/sql_graph_database.py b/funlib/persistence/graphs/sql_graph_database.py index 53d598e..cf66338 100644 --- a/funlib/persistence/graphs/sql_graph_database.py +++ b/funlib/persistence/graphs/sql_graph_database.py @@ -153,6 +153,10 @@ def get(value, default): metadata = self.__create_metadata() self._store_metadata(metadata) + @abstractmethod + def _drop_edges(self) -> None: + pass + @abstractmethod def _drop_tables(self) -> None: pass diff --git a/funlib/persistence/graphs/sqlite_graph_database.py b/funlib/persistence/graphs/sqlite_graph_database.py index a73aae3..80b927c 100644 --- a/funlib/persistence/graphs/sqlite_graph_database.py +++ b/funlib/persistence/graphs/sqlite_graph_database.py @@ -67,6 +67,10 @@ def edge_array_columns(self): } return self._edge_array_columns + def _drop_edges(self) -> None: + logger.info("dropping edges table %s", self.edges_table_name) + self.cur.execute(f"DROP TABLE IF EXISTS {self.edges_table_name}") + def _drop_tables(self) -> None: logger.info( "dropping collections %s, %s",