Skip to content

Commit

Permalink
close session after dropping/creating tables
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrOertlin committed May 8, 2024
1 parent 0ef44d9 commit 6ad9a3a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions genotype_api/database/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,14 @@ def create_all_tables() -> None:
"""Create all tables in genotype api."""
session: Session = get_session()
Base.metadata.create_all(bind=session.get_bind())
close_session()


def drop_all_tables() -> None:
"""Drop all tables in genotype api."""
session: Session = get_session()
Base.metadata.drop_all(bind=session.get_bind())
close_session()


def get_tables() -> list[str]:
Expand Down

0 comments on commit 6ad9a3a

Please sign in to comment.