Skip to content

Create Database Initialization Listener Interface #12377

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
3 tasks
jdpgrailsdev opened this issue Apr 26, 2022 · 0 comments
Closed
3 tasks

Create Database Initialization Listener Interface #12377

jdpgrailsdev opened this issue Apr 26, 2022 · 0 comments

Comments

@jdpgrailsdev
Copy link
Contributor

Tell us about the problem you're trying to solve

The existing code couples database access with connection initialization. The system wants to gate service startup on database creation and migration. Separating these two concerns will make it easier to adapt the code to an application framework.

Describe the solution you’d like

The solution to this coupling is to replace the per-database initialization logic in the existing DatabaseInstance implementations into a series of event listeners which can be invoked by the framework (e.g. Micronaut) at startup to perform the database initialization check. See the "proposed state" portion of the Whimsical diagram for more details.

Acceptance Criteria

  • Introduces a DatabaseInitializationEventListener interface
  • Implementation event listener class created for each database
  • Initialization logic is copied from DatabaseInstance /subclasses to the appropriate listener implementation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant