Skip to content

Support alternate database backend drivers#133

Merged
runleveldev merged 3 commits intomainfrom
116-support-alternate-database-backend-drivers
Nov 24, 2025
Merged

Support alternate database backend drivers#133
runleveldev merged 3 commits intomainfrom
116-support-alternate-database-backend-drivers

Conversation

@runleveldev
Copy link
Copy Markdown
Collaborator

This pull request introduces multi-database support and refactors migration scripts for improved safety and maintainability. The configuration now supports MySQL, PostgreSQL, and SQLite, with environment-driven selection. Several migrations have been updated to use Sequelize's safer bulk operations and proper identifier quoting, reducing the risk of SQL injection and improving compatibility across dialects. Additionally, the sequelize initialization and dependencies have been updated to align with the new database support.

Database Configuration and Initialization

  • The config.js file now supports MySQL, PostgreSQL, and SQLite, selecting the dialect and relevant settings based on environment variables. Throws an error for unsupported dialects. (create-a-container/config/config.js)
  • The Sequelize instance in models/index.js is now initialized directly from the config object, simplifying code and supporting the new config structure. (create-a-container/models/index.js)

Migration Safety and Compatibility

  • Migration scripts now use bulkUpdate and identifier quoting instead of raw SQL queries, reducing SQL injection risk and improving compatibility. This affects node assignment logic and updates in add-node-field-to-containers.js, convert-container-node-to-node-id.js, and related migrations. [1] [2] [3]
  • Node seeding in create-node.js now selects distinct node names and uses bulkInsert for safer and more portable data insertion. (create-a-container/migrations/20251104193601-create-node.js)

Dependency Updates

  • Added pg and sqlite3 to dependencies in package.json to support PostgreSQL and SQLite. (create-a-container/package.json)

@runleveldev runleveldev linked an issue Nov 18, 2025 that may be closed by this pull request
@runleveldev runleveldev changed the title 116 support alternate database backend drivers Support alternate database backend drivers Nov 19, 2025
@runleveldev runleveldev merged commit c6e38b2 into main Nov 24, 2025
3 checks passed
@runleveldev runleveldev deleted the 116-support-alternate-database-backend-drivers branch November 24, 2025 18:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support Alternate Database Backend Drivers

2 participants