Skip to content

feat: add MySQL support across Karya frameworks#512

Merged
niteshpurohit merged 5 commits into
mainfrom
feat/implement-mysql-backend
May 20, 2026
Merged

feat: add MySQL support across Karya frameworks#512
niteshpurohit merged 5 commits into
mainfrom
feat/implement-mysql-backend

Conversation

@niteshpurohit
Copy link
Copy Markdown
Member

  • Implemented MySQL migration installation for Karya::Hanami, Karya::Rails, Karya::Roda, and Karya::Sinatra.
  • Added integration tests for MySQL backend functionality in each framework to ensure proper operation.
  • Updated Gemfiles to include the mysql2 gem for MySQL database interactions.
  • Enhanced existing support files to handle MySQL database creation and teardown during tests.
  • Refactored code to delegate MySQL migration installation through respective framework support modules.

closes: #134

- Implemented MySQL migration installation for Karya::Hanami, Karya::Rails, Karya::Roda, and Karya::Sinatra.
- Added integration tests for MySQL backend functionality in each framework to ensure proper operation.
- Updated Gemfiles to include the mysql2 gem for MySQL database interactions.
- Enhanced existing support files to handle MySQL database creation and teardown during tests.
- Refactored code to delegate MySQL migration installation through respective framework support modules.

closes: #134
@niteshpurohit niteshpurohit self-assigned this May 20, 2026
Copilot AI review requested due to automatic review settings May 20, 2026 02:35
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds first-class MySQL backend support to core Karya and wires it through the supported framework integrations (Rails, Hanami, Roda, Sinatra), including migration installers and E2E coverage.

Changes:

  • Implement Karya::Backend::MySQL + Karya::QueueStore::MySQL, shared MySQL schema catalog, and migration generators (Active Record + Sequel), with matching RBS and unit specs.
  • Add framework-level install_mysql_migration delegation and MySQL E2E integration specs.
  • Add MySQL E2E test helpers, CI MySQL service wiring, docs updates, and mysql2 dev/test dependencies.

Reviewed changes

Copilot reviewed 51 out of 60 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
spec/support/postgres_e2e_support.rb Qualify module function calls
spec/support/mysql_e2e_support.rb Add MySQL test DB helper
spec/support/framework_postgres_backend_support.rb Add with_mysql_backend helper
gems/karya-sinatra/spec/karya/sinatra_spec.rb Sinatra MySQL migration delegation spec
gems/karya-sinatra/spec/karya/sinatra_mysql_e2e_spec.rb Sinatra MySQL E2E coverage
gems/karya-sinatra/sig/karya/sinatra.rbs Type install_mysql_migration
gems/karya-sinatra/lib/karya/sinatra.rb Delegate MySQL migration install
gems/karya-sinatra/Gemfile.lock Add mysql2 + lock updates
gems/karya-sinatra/Gemfile Add mysql2 dependency
gems/karya-roda/spec/karya/roda_spec.rb Roda MySQL migration delegation spec
gems/karya-roda/spec/karya/roda_mysql_e2e_spec.rb Roda MySQL E2E coverage
gems/karya-roda/sig/karya/roda.rbs Type install_mysql_migration
gems/karya-roda/lib/karya/roda.rb Delegate MySQL migration install
gems/karya-roda/Gemfile.lock Add mysql2 + lock updates
gems/karya-roda/Gemfile Add mysql2 dependency
gems/karya-rails/spec/karya/rails_spec.rb Rails MySQL migration delegation spec
gems/karya-rails/spec/karya/rails_mysql_e2e_spec.rb Rails MySQL E2E coverage
gems/karya-rails/sig/karya/rails.rbs Type install_mysql_migration
gems/karya-rails/lib/karya/rails.rb Delegate MySQL migration install
gems/karya-rails/gemfiles/rails_edge.gemfile.lock Add mysql2 to edge lockfile
gems/karya-rails/gemfiles/rails_8_1.gemfile.lock Add mysql2 to Rails 8.1 lockfile
gems/karya-rails/gemfiles/rails_8_0.gemfile.lock Add mysql2 to Rails 8.0 lockfile
gems/karya-rails/gemfiles/rails_7_2.gemfile.lock Add mysql2 to Rails 7.2 lockfile
gems/karya-rails/Gemfile.lock Add mysql2 + lock updates
gems/karya-rails/Gemfile Add mysql2 dependency
gems/karya-hanami/spec/karya/hanami_mysql_e2e_spec.rb Hanami MySQL E2E coverage
gems/karya-hanami/spec/karya/hanami_integration_spec.rb Hanami MySQL migration delegation spec
gems/karya-hanami/sig/karya/hanami.rbs Type install_mysql_migration
gems/karya-hanami/lib/karya/hanami.rb Delegate MySQL migration install
gems/karya-hanami/Gemfile.lock Add mysql2 + lock updates
gems/karya-hanami/Gemfile Add mysql2 dependency
docs/pages/backends.md Document MySQL backend setup
core/karya/spec/karya/sequel_spec.rb Spec Sequel MySQL migration generator
core/karya/spec/karya/queue_store/my_sql_spec.rb Unit specs for MySQL queue store
core/karya/spec/karya/backend/my_sql_spec.rb Unit specs for MySQL backend wrapper
core/karya/spec/karya/active_record_spec.rb Spec Active Record MySQL migration generator
core/karya/spec/e2e/karya/cli_worker_mysql_spec.rb CLI worker E2E via MySQL backend
core/karya/sig/karya/sequel.rbs Type install_mysql_migration
core/karya/sig/karya/queue_store/mysql/internal/state_codec.rbs Type MySQL state codec
core/karya/sig/karya/queue_store/mysql/internal/persistence_mutex.rbs Type MySQL persistence mutex
core/karya/sig/karya/queue_store/mysql/internal/dependency_loader.rbs Type MySQL dependency loader
core/karya/sig/karya/queue_store/mysql.rbs Type MySQL queue store public surface
core/karya/sig/karya/internal/mysql_schema_catalog.rbs Type MySQL schema catalog
core/karya/sig/karya/backend/mysql.rbs Type MySQL backend
core/karya/sig/karya/backend.rbs Register MySQL backend type
core/karya/sig/karya/active_record.rbs Type install_mysql_migration
core/karya/lib/karya/sequel.rb Implement Sequel MySQL migration install
core/karya/lib/karya/queue_store/mysql/internal/state_codec.rb Implement MySQL state codec
core/karya/lib/karya/queue_store/mysql/internal/persistence_mutex.rb Implement MySQL persistence mutex
core/karya/lib/karya/queue_store/mysql/internal/dependency_loader.rb Implement mysql2 dependency loader
core/karya/lib/karya/queue_store/mysql/internal.rb Wire MySQL internal requires
core/karya/lib/karya/queue_store/mysql.rb Implement MySQL durable queue store
core/karya/lib/karya/queue_store.rb Autoload MySQL queue store
core/karya/lib/karya/internal/mysql_schema_catalog.rb Centralize MySQL schema + migrations
core/karya/lib/karya/backend/mysql.rb Implement MySQL backend wrapper
core/karya/lib/karya/backend.rb Autoload MySQL backend
core/karya/lib/karya/active_record.rb Implement AR MySQL migration install
core/karya/Gemfile.lock Add mysql2 + lock updates
core/karya/Gemfile Add mysql2 dependency
.github/workflows/shared-ci.yml Add MySQL service/env for E2E

Comment thread spec/support/framework_sql_backend_support.rb
Comment thread core/karya/sig/karya/queue_store/mysql.rbs
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 55 out of 64 changed files in this pull request and generated 8 comments.

Comment thread core/karya/lib/karya/sequel.rb
Comment thread core/karya/lib/karya/active_record.rb
Comment thread core/karya/lib/karya/queue_store/mysql.rb
Comment thread core/karya/lib/karya/queue_store/mysql.rb
Comment thread spec/support/framework_sql_backend_support.rb
Comment thread core/karya/spec/karya/queue_store/my_sql_spec.rb
Comment thread core/karya/spec/karya/backend/my_sql_spec.rb
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 55 out of 64 changed files in this pull request and generated 5 comments.

Comment thread core/karya/sig/karya/active_record.rbs
Comment thread core/karya/sig/karya/sequel.rbs
Comment thread core/karya/lib/karya/active_record.rb Outdated
Comment thread core/karya/spec/karya/queue_store/my_sql_spec.rb
Comment thread core/karya/spec/karya/backend/my_sql_spec.rb
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 55 out of 64 changed files in this pull request and generated 4 comments.

Comment thread core/karya/lib/karya/queue_store/mysql.rb Outdated
Comment thread core/karya/lib/karya/queue_store/mysql/internal/persistence_mutex.rb Outdated
Comment thread core/karya/spec/karya/backend/my_sql_spec.rb
Comment thread core/karya/spec/karya/queue_store/my_sql_spec.rb
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 55 out of 64 changed files in this pull request and generated 2 comments.

Comment thread core/karya/spec/karya/queue_store/my_sql_spec.rb
Comment thread core/karya/spec/karya/backend/my_sql_spec.rb
@niteshpurohit niteshpurohit merged commit 3ef36dd into main May 20, 2026
26 checks passed
@niteshpurohit niteshpurohit deleted the feat/implement-mysql-backend branch May 20, 2026 03:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement the MySQL backend

2 participants