Browse Source

[rails] Use trilogy for the MySQL adapter (#8471)

Trilogy is a new client library for MySQL-compatible database servers,
designed for performance, flexibility, and ease of embedding.
It is used by Github and Shopify in production and will probably replace
the `mysql2` library.
https://github.com/trilogy-libraries/trilogy
Petrik de Heus 1 year ago
parent
commit
efd7e7aa5e

+ 1 - 1
frameworks/Ruby/rails/Gemfile

@@ -2,7 +2,7 @@ ruby '~> 3.2'
 
 
 source 'https://rubygems.org'
 source 'https://rubygems.org'
 
 
-gem 'mysql2', '0.5.5', group: :mysql
+gem 'trilogy', group: :mysql
 gem 'oj', '~> 3.16'
 gem 'oj', '~> 3.16'
 gem 'pg', '1.5.4', group: :postgresql
 gem 'pg', '1.5.4', group: :postgresql
 gem 'puma', '~> 6.4'
 gem 'puma', '~> 6.4'

+ 1 - 1
frameworks/Ruby/rails/config.toml

@@ -35,4 +35,4 @@ os = "Linux"
 orm = "Full"
 orm = "Full"
 platform = "Rack"
 platform = "Rack"
 webserver = "Puma"
 webserver = "Puma"
-versus = "rack-puma-mri"
+versus = "rack-puma-mri"

+ 1 - 1
frameworks/Ruby/rails/config/database.yml

@@ -15,7 +15,7 @@ test:
 
 
 production_mysql:
 production_mysql:
   <<: *default
   <<: *default
-  adapter: mysql2
+  adapter: trilogy
 
 
 production_postgresql:
 production_postgresql:
   <<: *default
   <<: *default

+ 1 - 1
frameworks/Ruby/rails/rails.dockerfile

@@ -8,7 +8,7 @@ WORKDIR /rails
 COPY ./Gemfile* /rails/
 COPY ./Gemfile* /rails/
 
 
 ENV BUNDLE_FORCE_RUBY_PLATFORM=true
 ENV BUNDLE_FORCE_RUBY_PLATFORM=true
-ENV BUNDLE_WITHOUT=mysql
+ENV BUNDLE_WITHOUT=trilogy
 RUN bundle install --jobs=8
 RUN bundle install --jobs=8
 
 
 COPY . /rails/
 COPY . /rails/