vastorbit.drop¶
- vastorbit.drop(name: str | None = None, method: Literal['auto', 'table', 'view', 'schema'] = 'auto', raise_error: bool = False) bool¶
Drops the input relation. This can be a view, table, or schema.
- Parameters:
name (str, optional) – Relation name. If empty, the function drops all vastorbit temporary elements.
method (str, optional) –
Method used to drop.
- auto:
identifies the table or view to drop. It never drops an entire schema unless the method is set to ‘schema’.
- table:
drops the input table.
- view:
drops the input view.
- schema:
drops the input schema.
raise_error (bool, optional) – If the object couldn’t be dropped, this function raises an error.
- Returns:
True if the relation was dropped, False otherwise.
- Return type:
bool
Examples
Create a table:
from vastorbit.sql import create_table create_table( table_name = "table_example", schema = "public", dtype = {"name": "VARCHAR(60)"}, )
Drop the table:
from vastorbit.sql import drop drop(name = "public.table_example")
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.