weather-gov / weather.gov

weather.gov 2.0
Other
327 stars 9 forks source link

[Interop layer] Refactor database utility to remove top-level functionality #1879

Open greg-does-weather opened 1 week ago

greg-does-weather commented 1 week ago

Description

The database utility currently runs a database check that will cause the entire app to fail to load if there is not database connection. This is intentional. However, having that check run in top-level code makes it more complicated to mock the database in other modules. Instead, we should put that initialization/check code into a function that is called by the main script. Then it will no longer be necessary to load other modules dynamically to avoid grabbing the wrong database object.

This could possibly be done alongside #1756.

Acceptance criteria

colinmurphy01 commented 1 week ago

If paired with #1756, I'm assuming this is not required prior to deploy to staging?

greg-does-weather commented 1 week ago

Correct