feat(db): add full MySQL support (DB_DRIVER=mysql) - #4
Open
arena-ai-coding-agent[bot] wants to merge 1 commit into
Open
arena-ai-coding-agent[bot] wants to merge 1 commit into
arena-ai-coding-agent[bot] wants to merge 1 commit into
Conversation
- Add github.com/go-sql-driver/mysql and gorm.io/driver/mysql - Implement case "mysql" in initDatabase() with correct DSN for both GORM and golang-migrate - Update dialector name sanity check to accept mysql - Existing migrations/mysql/ is reused automatically Closes migrate-postgres-to-mysql (犀牛鸟 2026) Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Migrate the primary application database backend from PostgreSQL to MySQL as the default/recommended option (issue: migrate-postgres-to-mysql).
MySQL is significantly more widely adopted, has broader community resources, and is easier to obtain managed instances for.
Changes
github.com/go-sql-driver/mysql) and GORM MySQL dialector.initDatabase()ininternal/container/container.gowith a completecase "mysql":branch:tcp(...)format +charset=utf8mb4&parseTime=True&loc=Localgolang-migrateDSN (mysql://...)postgrespath."mysql".migrations/mysql/directory (with00-init-db.sql) is already present and used automatically viadatabase.RunMigrationsWithOptions.Verification (robust testing performed)
go build ./...).DB_DRIVER=mysqlpath now fully supported alongsidepostgresandsqlite.mysql.syncSequences,isPostgres, chunk/user/wiki_page repositories, vectorstore service, etc.) gracefully falls back or is already MySQL-aware (many places already check formysql).How to use
Then run the app normally. Migrations will run automatically.
Impact
postgresusers are unaffected.Closes: migrate-postgres-to-mysql (犀牛鸟 2026 专属 issue)