Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switched to mysql2 library #14258

Merged
merged 1 commit into from
Mar 3, 2022
Merged

Switched to mysql2 library #14258

merged 1 commit into from
Mar 3, 2022

Conversation

daniellockyer
Copy link
Member

@daniellockyer daniellockyer commented Mar 2, 2022

refs https://github.com/TryGhost/Toolbox/issues/174

  • this commit switches Ghost from using the mysql library to the
    mysql2 one
  • we've done this for several reasons:
    • mysql2 is more actively maintained
    • mysql2 natively supports the default auth plugin on MySQL 8
    • mysql2 is fasterrrr
  • there have been various other commits refactoring the groundwork for
    this commit but this commit should be short and sweet:
    • alias mysql to mysql2 client so we maintain backwards
      compatibility with all configs who use "client": "mysql"
    • enabled decimalNumbers so we maintain the same functionality as
      mysql
    • replaced the dependencies and updated knex-migrator
    • hardcoded the newer authentication plugin in MySQL 8 CI. Before
      switching to mysql2, this would break because it didn't support
      this

@daniellockyer daniellockyer added the running-ci-checks PR's which do not need/want review label Mar 2, 2022
@daniellockyer daniellockyer self-assigned this Mar 2, 2022
@codecov
Copy link

codecov bot commented Mar 2, 2022

Codecov Report

Merging #14258 (06934e4) into main (da0dee5) will decrease coverage by 0.01%.
The diff coverage is 14.28%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main   #14258      +/-   ##
==========================================
- Coverage   55.43%   55.41%   -0.02%     
==========================================
  Files         564      564              
  Lines       46704    46708       +4     
  Branches     3974     3975       +1     
==========================================
- Hits        25889    25885       -4     
- Misses      20774    20782       +8     
  Partials       41       41              
Impacted Files Coverage Δ
core/server/data/db/connection.js 54.09% <0.00%> (-0.91%) ⬇️
core/server/data/schema/clients/index.js 100.00% <ø> (ø)
core/shared/config/utils.js 81.52% <20.00%> (-2.57%) ⬇️
core/server/models/base/plugins/events.js 69.48% <0.00%> (-1.48%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update da0dee5...06934e4. Read the comment docs.

@daniellockyer daniellockyer changed the title WIP: switched to mysql2 DB client Switched to mysql2 library Mar 3, 2022
@daniellockyer daniellockyer marked this pull request as ready for review March 3, 2022 08:47
refs TryGhost/Toolbox#174

- this commit switches Ghost from using the `mysql` library to the
  `mysql2` one
- we've done this for several reasons:
  - `mysql2` is more actively maintained
  - `mysql2` natively supports the default auth plugin on MySQL 8
  - `mysql2` is fasterrrr
- there have been various other commits refactoring the groundwork for
  this commit but this commit should be short and sweet:
  - alias `mysql` to `mysql2` client so we maintain backwards
    compatibility with all configs who use `"client": "mysql"`
  - enabled `decimalNumbers` so we maintain the same functionality as
    `mysql`
  - replaced the dependencies and updated `knex-migrator`
  - hardcoded the newer authentication plugin in MySQL 8 CI. Before
    switching to `mysql2`, this would break because it didn't support
    this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
running-ci-checks PR's which do not need/want review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant