Auto start and stop Postgres on application start and close, respectively. #29
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Postgres starts when the application is opened, and it's stopped when the application is closed.
Additionally, some of the previous visual components (and most of the methods producing them) have been removed.
In order to test this, take the following steps for both dev and prod (on Windows):
delete the PGDATA directory locally (start with a clean DB slate)
Start the app, and see that the app is initializing the DB while displaying the following:
After a few moments, the spinner should disappear:
Verify postgres is running on port 5442
Close the application
Verify postgres is no longer running
Note, I ran into an issue in PROD only where
execSync
(I ended up switching tospawnSync
) couldn't navigate directories with spaces in the name, and it wasn't able to close Postgres. It could be worthwhile to test that the installed application can close Postgres when in PROD when the app is located in a directory with a space in the name.