Learn R Programming

motherduck (version 0.2.0)

drop_share: Drop a MotherDuck share

Description

Drops (deletes) a specified share from your MotherDuck account. If the share does not exist, a warning is displayed. This function safely validates the connection and share name before executing the operation.

Usage

drop_share(.con, share_name)

Value

Invisibly returns NULL. Side effect: the specified share is removed if it exists.

Arguments

.con

A valid DBI connection (DuckDB / MotherDuck).

share_name

Character. The name of the share to be dropped.

Details

The function first validates that the connection is active. It then checks whether the specified share exists in the account. If it does, the share is dropped using a DROP SHARE IF EXISTS SQL command. If the share does not exist, a warning is shown. After the operation, the current user is displayed.

See Also

Other db-manage: alter_table_schema(), copy_tables_to_new_location(), create_database(), create_if_not_exists_share(), create_or_replace_share(), create_schema(), create_table(), delete_and_create_schema(), delete_database(), delete_schema(), delete_table(), describe_share(), list_owned_shares(), list_shared_with_me_shares(), upload_database_to_md()

Examples

Run this code
if (FALSE) {
drop_share(con_md, "test_share")
}

Run the code above in your browser using DataLab