Skip to content

Add drop database #25523

@pauldix

Description

@pauldix

We need a way to drop a database by name. This should be an HTTP API in the same area where we set options for last value cache, etc. We'll also want to add support to issue the command via the CLI. By default, the CLI should prompt the user to confirm they want to do the operation. There should be a command line option to auto-confirm.

Under the covers, the server should look up the name and log into the WAL a catalog operation to drop the DB by its id and the time the command was issued. When this is applied to the catalog, the name of the DB should be updated to {db_name} - {time of drop} and a marker should be applied to the DB that states that it is soft deleted.

The write buffer and last value caches should be cleared of any data they have for that dbid.

Actually deleting the underlying files and removing the old db from the Catalog will be a separate operation that we can create in the future.

We'll also want to have an undelete option, but that can be handled as separate follow up work.

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions