verticapy.drop#
- verticapy.drop(name: str | None = None, method: Literal['table', 'view', 'model', 'geo', 'text', 'auto', 'schema'] = 'auto', raise_error: bool = False) bool #
Drops the input relation. This can be a model, view, table, text index, schema, or geo index.
Parameters#
- name: str, optional
Relation name. If empty, the function drops all VerticaPy temporary elements.
- method: str, optional
Method used to drop.
- auto:
identifies the table / view / index / model to drop. It never drops an entire schema unless the method is set to ‘schema’.
- model:
drops the input model.
- table:
drops the input table.
- view:
drops the input view.
- geo:
drops the input geo index.
- text:
drops the input text index.
- schema:
drops the input schema.
- raise_error: bool, optional
If the object couldn’t be dropped, this function raises an error.
Returns#
- bool
True if the relation was dropped, False otherwise.
Examples#
Create a table:
from verticapy.sql import create_table create_table( table_name = "table_example", schema = "public", dtype = {"name": "VARCHAR(60)"}, ) Out[2]: True
Drop the table:
from verticapy.sql import drop drop(name = "public.table_example") Out[4]: True
Warning
Dropping an element permanently removes it from the database. Please exercise caution, as this action is irreversible.
See also
create_table()
: Creates a table.