feat(backend): add the db connection
This commit is contained in:
38
backend/main.py
Normal file
38
backend/main.py
Normal file
@@ -0,0 +1,38 @@
|
||||
from database.repository import Repository
|
||||
from database.connection import DatabaseConnection
|
||||
|
||||
def main():
|
||||
db = DatabaseConnection("database.db")
|
||||
repository = Repository(db)
|
||||
|
||||
# Retrieve data
|
||||
classifications = repository.get_all_classifications()
|
||||
members = repository.get_all_members()
|
||||
service_types = repository.get_all_service_types()
|
||||
services = repository.get_all_services()
|
||||
service_availability = repository.get_all_service_availability()
|
||||
|
||||
print("Classifications:")
|
||||
for classification in classifications:
|
||||
print(classification)
|
||||
|
||||
print("\nMembers:")
|
||||
for member in members:
|
||||
print(member)
|
||||
|
||||
print("\nService Types:")
|
||||
for service_type in service_types:
|
||||
print(service_type)
|
||||
|
||||
print("\nServices:")
|
||||
for service in services:
|
||||
print(service)
|
||||
|
||||
print("\nService Availability:")
|
||||
for availability in service_availability:
|
||||
print(availability)
|
||||
|
||||
db.close_connection()
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in New Issue
Block a user