Implement dynamic database management to support both MySQL and PostgreSQL databases in the SafeBase project. This will allow us to connect to different database types based on environment variables, enhancing the flexibility of the application.
Context
Currently, the application supports only a single database type. Introducing dynamic database management will enable users to select either MySQL or PostgreSQL for data storage. This flexibility is crucial for meeting diverse user needs and use cases.
Objectives
Add support for PostgreSQL in addition to MySQL.
Create a dynamic connection mechanism in db.js based on environment variables.
Ensure all CRUD operations function with both MySQL and PostgreSQL.
Acceptance Criteria
The application can connect to either a MySQL or PostgreSQL database based on environment configurations.
CRUD operations work correctly for both database types.
The application logs the connected database type on startup.
Tasks
[x] Create and initialize a new working branch
Branch name format: feature/database-management
[ ] Install PostgreSQL dependencies (pg and pg-hstore).
[ ] Modify db.js to support dynamic database connection based on the DB_TYPE environment variable.
[ ] Update CRUD routes to handle queries for both MySQL and PostgreSQL.
[ ] Test CRUD operations for both MySQL and PostgreSQL databases.
[ ] Write the commit message
Use the naming conventions: feat(db): implement database management for MySQL and PostgreSQL
[ ] Create the Pull Request
Ensure the Pull Request follows the naming and description conventions.
Summary
Implement dynamic database management to support both MySQL and PostgreSQL databases in the SafeBase project. This will allow us to connect to different database types based on environment variables, enhancing the flexibility of the application.
Context
Currently, the application supports only a single database type. Introducing dynamic database management will enable users to select either MySQL or PostgreSQL for data storage. This flexibility is crucial for meeting diverse user needs and use cases.
Objectives
db.js
based on environment variables.Acceptance Criteria
Tasks
feature/database-management
pg
andpg-hstore
).db.js
to support dynamic database connection based on theDB_TYPE
environment variable.feat(db): implement database management for MySQL and PostgreSQL
Resources
UML Diagrams References
Branch Name
feature/database-management