Skip to content
This repository was archived by the owner on Dec 8, 2024. It is now read-only.

feat: simple destroy database function #37

Merged
merged 1 commit into from
Aug 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions client/data/routines.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,12 @@ def init_database() -> None:
connection.commit()


def destroy_database() -> None:
"""Delete the current database if it exists."""
with resources.as_file(DATABASE_RESOURCE) as database_file:
database_file.unlink(missing_ok=True)


def create_user() -> int:
"""Creates a new user in the database.

Expand Down