def debug_dump(db: sqlalchemy_db.SQLAlchemyDB):
    """Debug function to dump all tables in the database."""

    print("  # registry")
    for n, t in db.orm.registry.items():
        print("   ", n, t)

    with db.session.begin() as session:
        print("  # feedback_def")
        ress = session.query(db.orm.FeedbackDefinition).all()
        for res in ress:
            print("    feedback_def", res.feedback_definition_id)

        print("  # app")
        ress = session.query(db.orm.AppDefinition).all()
        for res in ress:
            print("    app", res.app_id)  # no feedback results
            for subres in res.records:
                print("      record", subres.record_id)

        print("  # record")
        ress = session.query(db.orm.Record).all()
        for res in ress:
            print("    record", res.record_id)
            for subres in res.feedback_results:
                print("      feedback_result", subres.feedback_result_id)

        print("  # feedback")
        ress = session.query(db.orm.FeedbackResult).all()
        for res in ress:
            print(
                "    feedback_result",
                res.feedback_result_id,
                res.feedback_definition,
            )
Debug function to dump all tables in the database.
tests/integration/test_database.py