(
        self, database: Optional[str], schema: Optional[str],
    )
Drop the given schema and remove it from the set of known schemas.

        Then remove all its contents (and their dependents, etc) as well.
Drop the given schema and remove it from the set of known schemas.
Drop the given schema and remove it from the set of known schemas .
def drop_schema(
        self, database: Optional[str], schema: Optional[str],
    ) -> None:
        """Drop the given schema and remove it from the set of known schemas.

        Then remove all its contents (and their dependents, etc) as well.
        """
        key = (lowercase(database), lowercase(schema))
        if key not in self.schemas:
            return

        # avoid iterating over self.relations while removing things by
        # collecting the list first.

        with self.lock:
            to_remove = self._list_relations_in_schema(database, schema)
            self._remove_all(to_remove)
            # handle a drop_schema race by using discard() over remove()
            self.schemas.discard(key)
def drop_schema ( self , database : Optional [ str ] , schema : Optional [ str ] , ) -> None : key = ( lowercase ( database ) , lowercase ( schema ) ) if key not in self . schemas : return # avoid iterating over self.relations while removing things by # collecting the list first. with self . lock : to_remove = self . _list_relations_in_schema ( database , schema ) self . _remove_all ( to_remove ) # handle a drop_schema race by using discard() over remove() self . schemas . discard ( key )