-
Notifications
You must be signed in to change notification settings - Fork 4
Update library to mysql2 #6
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,9 +7,9 @@ const ColumnDefinitions = require('./ColumnDefinitions'); | |
const KeyDefinitions = require('./KeyDefinitions'); | ||
const MySQLTable = require('./MySQLTable'); | ||
const Operation = require('./Operation'); | ||
const Pool = require('mysql/lib/Pool'); | ||
const PoolConfig = require('mysql/lib/PoolConfig'); | ||
const SqlString = require('mysql/lib/protocol/SqlString'); | ||
const {Pool} = require('mysql2'); | ||
const mysql = require('mysql2'); | ||
const SqlString = require('sqlstring'); | ||
const TableDefinition = require('./TableDefinition'); | ||
|
||
const MIGRATION_STRATEGIES = [ | ||
|
@@ -44,9 +44,11 @@ function validateMigrationStrategy(strategy) { | |
class PoolPlus extends Pool { | ||
constructor(config) { | ||
const plusOptions = config.plusOptions || {}; | ||
delete config.plusOptions; | ||
validateMigrationStrategy(plusOptions.migrationStrategy); | ||
|
||
super({config: new PoolConfig(config)}); | ||
const poolConfig = mysql.createPool(config).config; | ||
super({config: poolConfig}); | ||
Comment on lines
+50
to
+51
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It looks like you're trying to be less hacky, but this is going to create an extra, unused pool. This code doesn't need to change if you do the suggestion I'll post above. |
||
|
||
this._allowAlterInProduction = plusOptions.allowAlterInProduction || false; | ||
this._debug = plusOptions.debug || false; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,7 +28,8 @@ | |
"query" | ||
], | ||
"dependencies": { | ||
"mysql": "^2.18.1" | ||
"mysql2": "^3.2.0", | ||
"sqlstring": "^2.3.3" | ||
}, | ||
"devDependencies": { | ||
"@nwoltman/eslint-config": "~0.6.0", | ||
|
@@ -38,12 +39,12 @@ | |
"grunt": "^1.0.4", | ||
"grunt-env": "^1.0.1", | ||
"grunt-eslint": "^22.0.0", | ||
"grunt-jsdoc-to-markdown": "^5.0.0", | ||
"grunt-jsdoc-to-markdown": "^6.0.0", | ||
"grunt-mocha-istanbul": "^5.0.2", | ||
"grunt-mocha-test": "^0.13.3", | ||
"istanbul": "^0.4.5", | ||
"jit-grunt": "^0.10.0", | ||
"mocha": "^7.0.1", | ||
"mocha": "^10.2.0", | ||
Comment on lines
+42
to
+47
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would you mind undoing these? I know the devDepencies are out of date, but these sorts of changes should be done separately. |
||
"semver": "^7.1.3", | ||
"should": "~13.2.3", | ||
"should-sinon": "0.0.6", | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.