Currently, the connectDatabase function only supports Sequelize for managing database connections. To enhance flexibility and support use cases where raw SQL access is preferred, I propose adding an option to use either Sequelize or pure MySQL.
Proposed Changes
- Add a useSequelize option in the ConnectOptions interface to toggle between Sequelize and MySQL.
- Use Sequelize as the default option to maintain backward compatibility.
- Add functionality for connecting to MySQL directly using the mysql2/promise library when useSequelize is set to false.
- Ensure proper connection testing for both modes (Sequelize and pure MySQL).
Currently, the connectDatabase function only supports Sequelize for managing database connections. To enhance flexibility and support use cases where raw SQL access is preferred, I propose adding an option to use either Sequelize or pure MySQL.
Proposed Changes