-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Access error directly via variable * Remove unnecesary 'if' clause The default value of a string variable is already an empty string, and there was no additional error handling done. * Move printing logic to main script Allows for better abstraction and improves reusability. * Refactor to use common DB "connect" helper Reduces code duplication. * Refactor to use common DB "close" helper * Rename `d` to `dbConn` Makes the name more descriptive. * Add comment * Replace string with constants Prevents bugs. * Rename `getConnectedDBName` to `getDBName` * Change createDB signature Hides implementation details of the config object as the function only needs to be aware of the database name to create, not how it is derived from. * Change dropDB signature Similar to createDB, this improves abstraction. * Refactor script setup to separate function Improves single responsibility. * Simplify dropDB implementation * Refactor createDB implementation * Move happy path to outside if condition * Simplify error handling * Update logging behavior * Update log colors * Remove unnecessary code
- Loading branch information
1 parent
dd2f349
commit f369819
Showing
2 changed files
with
69 additions
and
96 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters