Skip to content

Commit d84ec33

Browse files
build - v1.13.0
1 parent b191c90 commit d84ec33

File tree

9 files changed

+82
-44
lines changed

9 files changed

+82
-44
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Download with your package manager of choice. The package name is `mysql-memory-
1717
- ```mysql-memory-server``` can run MySQL versions 5.7.19 and newer (if the version is already installed on your system)
1818
- ```mysql-memory-server``` can download and run MySQL versions (inclusive) 5.7.19 - 5.7.44, 8.0.0 - 8.0.44, 8.1.0 - 8.4.7, and 9.0.1 - 9.5.0 (if the version is not already installed on your system)
1919

20-
Extra system requirements apply when ```mysql-memory-server``` is downloading MySQL instead of running a version of MySQL that is already installed on the system. To see the requirements and learn more about the supported versions for download, [read the doc](https://github.com/Sebastian-Webster/mysql-memory-server-nodejs/blob/v1.12.2/docs/SUPPORTED_MYSQL_DOWNLOADS.md)
20+
Extra system requirements apply when ```mysql-memory-server``` is downloading MySQL instead of running a version of MySQL that is already installed on the system. To see the requirements and learn more about the supported versions for download, [read the doc](https://github.com/Sebastian-Webster/mysql-memory-server-nodejs/blob/v1.13.0/docs/SUPPORTED_MYSQL_DOWNLOADS.md)
2121

2222
## Example Usage - Application Code
2323

@@ -102,11 +102,11 @@ Description: Version of MySQL to use for the database. Uses semver for getting t
102102

103103
If left undefined:
104104
- If the system has MySQL installed, the system-installed version will be used. If the installed version is not supported by this package (currently <5.7.19), an error will be thrown unless `ignoreUnsupportedSystemVersion` is set to `true`.
105-
- If the system does not have MySQL installed, the latest version of MySQL that [this package supports downloading](https://github.com/Sebastian-Webster/mysql-memory-server-nodejs/blob/v1.12.2/docs/SUPPORTED_MYSQL_DOWNLOADS.md) will be downloaded.
105+
- If the system does not have MySQL installed, the latest version of MySQL that [this package supports downloading](https://github.com/Sebastian-Webster/mysql-memory-server-nodejs/blob/v1.13.0/docs/SUPPORTED_MYSQL_DOWNLOADS.md) will be downloaded.
106106

107107
If defined:
108108
- If the version is older than 5.7.19, an error will be thrown as this package does not currently support those versions of MySQL.
109-
- If the desired version of MySQL is already installed on the system, the installed version will be used. Otherwise the selected version will be downloaded as long as this package [supports downloading it](https://github.com/Sebastian-Webster/mysql-memory-server-nodejs/blob/v1.12.2/docs/SUPPORTED_MYSQL_DOWNLOADS.md). If this package does not support downloading the selected version, or your system does not [meet the requirements](https://github.com/Sebastian-Webster/mysql-memory-server-nodejs/blob/v1.12.2/docs/SUPPORTED_MYSQL_DOWNLOADS.md) for that version to be ran, an error will be thrown.
109+
- If the desired version of MySQL is already installed on the system, the installed version will be used. Otherwise the selected version will be downloaded as long as this package [supports downloading it](https://github.com/Sebastian-Webster/mysql-memory-server-nodejs/blob/v1.13.0/docs/SUPPORTED_MYSQL_DOWNLOADS.md). If this package does not support downloading the selected version, or your system does not [meet the requirements](https://github.com/Sebastian-Webster/mysql-memory-server-nodejs/blob/v1.13.0/docs/SUPPORTED_MYSQL_DOWNLOADS.md) for that version to be ran, an error will be thrown.
110110

111111
- `dbName: string`
112112

dist/src/constants.d.ts

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,18 @@ export declare const OPTION_TYPE_CHECKS: OptionTypeChecks;
1515
export declare const MIN_SUPPORTED_MYSQL = "5.7.19";
1616
export declare const MySQLCDNDownloadsBaseURL = "https://cdn.mysql.com//Downloads/MySQL-";
1717
export declare const MySQLCDNArchivesBaseURL = "https://cdn.mysql.com/archives/mysql-";
18-
export declare const DOWNLOADABLE_MYSQL_VERSIONS: readonly ["5.7.19", "5.7.20", "5.7.21", "5.7.22", "5.7.23", "5.7.24", "5.7.25", "5.7.26", "5.7.27", "5.7.28", "5.7.29", "5.7.30", "5.7.31", "5.7.32", "5.7.33", "5.7.34", "5.7.35", "5.7.36", "5.7.37", "5.7.38", "5.7.39", "5.7.40", "5.7.41", "5.7.42", "5.7.43", "5.7.44", "8.0.0", "8.0.1", "8.0.2", "8.0.3", "8.0.4", "8.0.11", "8.0.12", "8.0.13", "8.0.14", "8.0.15", "8.0.16", "8.0.17", "8.0.18", "8.0.19", "8.0.20", "8.0.21", "8.0.22", "8.0.23", "8.0.24", "8.0.25", "8.0.26", "8.0.27", "8.0.28", "8.0.30", "8.0.31", "8.0.32", "8.0.33", "8.0.34", "8.0.35", "8.0.36", "8.0.37", "8.0.39", "8.0.40", "8.0.41", "8.0.42", "8.0.43", "8.1.0", "8.2.0", "8.3.0", "8.4.0", "8.4.2", "8.4.3", "8.4.4", "8.4.5", "8.4.6", "9.0.1", "9.1.0", "9.2.0", "9.3.0", "9.4.0"];
18+
export declare const DOWNLOADABLE_MYSQL_VERSIONS: readonly ["5.7.19", "5.7.20", "5.7.21", "5.7.22", "5.7.23", "5.7.24", "5.7.25", "5.7.26", "5.7.27", "5.7.28", "5.7.29", "5.7.30", "5.7.31", "5.7.32", "5.7.33", "5.7.34", "5.7.35", "5.7.36", "5.7.37", "5.7.38", "5.7.39", "5.7.40", "5.7.41", "5.7.42", "5.7.43", "5.7.44", "8.0.0", "8.0.1", "8.0.2", "8.0.3", "8.0.4", "8.0.11", "8.0.12", "8.0.13", "8.0.14", "8.0.15", "8.0.16", "8.0.17", "8.0.18", "8.0.19", "8.0.20", "8.0.21", "8.0.22", "8.0.23", "8.0.24", "8.0.25", "8.0.26", "8.0.27", "8.0.28", "8.0.30", "8.0.31", "8.0.32", "8.0.33", "8.0.34", "8.0.35", "8.0.36", "8.0.37", "8.0.39", "8.0.40", "8.0.41", "8.0.42", "8.0.43", "8.0.44", "8.1.0", "8.2.0", "8.3.0", "8.4.0", "8.4.2", "8.4.3", "8.4.4", "8.4.5", "8.4.6", "8.4.7", "9.0.1", "9.1.0", "9.2.0", "9.3.0", "9.4.0", "9.5.0"];
1919
export declare const MYSQL_ARCH_SUPPORT: {
2020
readonly darwin: {
21-
readonly arm64: "8.0.26 - 9.4.0";
22-
readonly x64: "5.7.19 - 9.4.0";
21+
readonly arm64: "8.0.26 - 9.5.0";
22+
readonly x64: "5.7.19 - 9.5.0";
2323
};
2424
readonly linux: {
25-
readonly arm64: "8.0.31 - 9.4.0";
26-
readonly x64: "5.7.19 - 9.4.0";
25+
readonly arm64: "8.0.31 - 9.5.0";
26+
readonly x64: "5.7.19 - 9.5.0";
2727
};
2828
readonly win32: {
29-
readonly x64: "5.7.19 - 9.4.0";
29+
readonly x64: "5.7.19 - 9.5.0";
3030
};
3131
};
3232
export declare const MYSQL_MIN_OS_SUPPORT: {
@@ -45,7 +45,7 @@ export declare const MYSQL_MIN_OS_SUPPORT: {
4545
readonly '8.0.28 - 8.0.31': "20.0.0";
4646
readonly '8.0.32 - 8.0.34': "21.0.0";
4747
readonly '8.0.35 - 8.0.39 || 8.1.0 - 8.4.2 || 9.0.1': "22.0.0";
48-
readonly '8.0.40 - 8.0.43 || 8.4.3 - 8.4.6 || 9.1.0 - 9.4.0': "23.0.0";
48+
readonly '8.0.40 - 8.0.44 || 8.4.3 - 8.4.7 || 9.1.0 - 9.5.0': "23.0.0";
4949
};
5050
};
5151
export declare const DMR_MYSQL_VERSIONS = "8.0.0 - 8.0.2";
@@ -60,33 +60,33 @@ export declare const MYSQL_MACOS_VERSIONS_IN_FILENAME: {
6060
readonly '8.0.30 - 8.0.31': "macos12";
6161
readonly '8.0.32 - 8.0.35 || 8.1.0 - 8.2.0': "macos13";
6262
readonly '8.0.36 - 8.0.40 || 8.3.0 - 8.4.3 || 9.0.1 - 9.1.0': "macos14";
63-
readonly '8.0.41 - 8.0.43 || 8.4.4 - 8.4.6 || 9.2.0 - 9.4.0': "macos15";
63+
readonly '8.0.41 - 8.0.44 || 8.4.4 - 8.4.7 || 9.2.0 - 9.5.0': "macos15";
6464
};
6565
export declare const MYSQL_LINUX_GLIBC_VERSIONS: {
6666
readonly x64: {
6767
readonly '5.7.19 - 8.0.20': "2.12";
68-
readonly '8.0.21 - 9.4.0': "2.17";
68+
readonly '8.0.21 - 9.5.0': "2.17";
6969
};
7070
readonly arm64: {
7171
readonly '5.7.19 - 8.0.20': "2.12";
7272
readonly '8.0.21 - 8.0.41 || 8.1.0 - 8.4.4 || 9.0.1 - 9.2.0': "2.17";
73-
readonly '8.0.42 - 8.0.43 || 8.4.5 - 8.4.6 || 9.3.0 - 9.4.0': "2.28";
73+
readonly '8.0.42 - 8.0.44 || 8.4.5 - 8.4.7 || 9.3.0 - 9.5.0': "2.28";
7474
};
7575
};
7676
export declare const MYSQL_LINUX_MINIMAL_INSTALL_AVAILABLE: {
7777
readonly '5.7.19 - 8.0.15': "no";
7878
readonly '8.0.16 - 8.0.20': "no-glibc-tag";
79-
readonly '8.0.21 - 9.4.0': "glibc-tag";
79+
readonly '8.0.21 - 9.5.0': "glibc-tag";
8080
};
8181
export declare const MYSQL_LINUX_MINIMAL_INSTALL_AVAILABLE_ARM64 = "8.0.33 - 8.0.41 || 8.1.0 - 8.4.4 || 9.0.1 - 9.2.0";
8282
export declare const MYSQL_LINUX_FILE_EXTENSIONS: {
8383
readonly x64: {
8484
readonly '5.7.19 - 8.0.11': "gz";
85-
readonly '8.0.12 - 9.4.0': "xz";
85+
readonly '8.0.12 - 9.5.0': "xz";
8686
};
8787
readonly arm64: {
8888
readonly '8.0.31 - 8.0.32': "gz";
89-
readonly '8.0.33 - 9.4.0': "xz";
89+
readonly '8.0.33 - 9.5.0': "xz";
9090
};
9191
};
9292
export declare const MYSQL_LINUX_MINIMAL_REBUILD_VERSIONS = "8.0.26";

dist/src/constants.js

Lines changed: 25 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
33
exports.MYSQL_LINUX_MINIMAL_REBUILD_VERSIONS = exports.MYSQL_LINUX_FILE_EXTENSIONS = exports.MYSQL_LINUX_MINIMAL_INSTALL_AVAILABLE_ARM64 = exports.MYSQL_LINUX_MINIMAL_INSTALL_AVAILABLE = exports.MYSQL_LINUX_GLIBC_VERSIONS = exports.MYSQL_MACOS_VERSIONS_IN_FILENAME = exports.RC_MYSQL_VERSIONS = exports.DMR_MYSQL_VERSIONS = exports.MYSQL_MIN_OS_SUPPORT = exports.MYSQL_ARCH_SUPPORT = exports.DOWNLOADABLE_MYSQL_VERSIONS = exports.MySQLCDNArchivesBaseURL = exports.MySQLCDNDownloadsBaseURL = exports.MIN_SUPPORTED_MYSQL = exports.OPTION_TYPE_CHECKS = exports.LOG_LEVELS = exports.DEFAULT_OPTIONS_KEYS = exports.DEFAULT_OPTIONS = void 0;
44
exports.getInternalEnvVariable = getInternalEnvVariable;
55
const semver_1 = require("semver");
6+
const fs_1 = require("fs");
67
exports.DEFAULT_OPTIONS = {
78
version: undefined,
89
dbName: 'dbdata',
@@ -18,7 +19,8 @@ exports.DEFAULT_OPTIONS = {
1819
downloadRetries: 10,
1920
initSQLString: '',
2021
arch: process.arch,
21-
xEnabled: 'FORCE'
22+
xEnabled: 'FORCE',
23+
initSQLFilePath: ''
2224
};
2325
exports.DEFAULT_OPTIONS_KEYS = Object.freeze(Object.keys(exports.DEFAULT_OPTIONS));
2426
exports.LOG_LEVELS = {
@@ -110,7 +112,12 @@ exports.OPTION_TYPE_CHECKS = {
110112
check: (opt) => opt === undefined || pluginActivationStates.includes(opt),
111113
errorMessage: `xEnabled must be either undefined or one of the following: ${pluginActivationStates.join(', ')}`,
112114
definedType: 'boolean'
113-
}
115+
},
116+
initSQLFilePath: {
117+
check: (opt) => opt === undefined || (typeof opt === 'string' && (0, fs_1.existsSync)(opt)),
118+
errorMessage: 'Option initSQLFilePath must be either undefined or a filepath string that points to a file that exists.',
119+
definedType: 'string'
120+
},
114121
};
115122
exports.MIN_SUPPORTED_MYSQL = '5.7.19';
116123
exports.MySQLCDNDownloadsBaseURL = 'https://cdn.mysql.com//Downloads/MySQL-';
@@ -119,22 +126,22 @@ exports.MySQLCDNArchivesBaseURL = 'https://cdn.mysql.com/archives/mysql-';
119126
exports.DOWNLOADABLE_MYSQL_VERSIONS = [
120127
'5.7.19', '5.7.20', '5.7.21', '5.7.22', '5.7.23', '5.7.24', '5.7.25', '5.7.26', '5.7.27', '5.7.28', '5.7.29', '5.7.30', '5.7.31', '5.7.32', '5.7.33', '5.7.34', '5.7.35', '5.7.36', '5.7.37', '5.7.38', '5.7.39', '5.7.40', '5.7.41', '5.7.42', '5.7.43', '5.7.44',
121128
'8.0.0', '8.0.1', '8.0.2', '8.0.3', '8.0.4',
122-
'8.0.11', '8.0.12', '8.0.13', '8.0.14', '8.0.15', '8.0.16', '8.0.17', '8.0.18', '8.0.19', '8.0.20', '8.0.21', '8.0.22', '8.0.23', '8.0.24', '8.0.25', '8.0.26', '8.0.27', '8.0.28', '8.0.30', '8.0.31', '8.0.32', '8.0.33', '8.0.34', '8.0.35', '8.0.36', '8.0.37', '8.0.39', '8.0.40', '8.0.41', '8.0.42', '8.0.43',
129+
'8.0.11', '8.0.12', '8.0.13', '8.0.14', '8.0.15', '8.0.16', '8.0.17', '8.0.18', '8.0.19', '8.0.20', '8.0.21', '8.0.22', '8.0.23', '8.0.24', '8.0.25', '8.0.26', '8.0.27', '8.0.28', '8.0.30', '8.0.31', '8.0.32', '8.0.33', '8.0.34', '8.0.35', '8.0.36', '8.0.37', '8.0.39', '8.0.40', '8.0.41', '8.0.42', '8.0.43', '8.0.44',
123130
'8.1.0', '8.2.0', '8.3.0',
124-
'8.4.0', '8.4.2', '8.4.3', '8.4.4', '8.4.5', '8.4.6',
125-
'9.0.1', '9.1.0', '9.2.0', '9.3.0', '9.4.0'
131+
'8.4.0', '8.4.2', '8.4.3', '8.4.4', '8.4.5', '8.4.6', '8.4.7',
132+
'9.0.1', '9.1.0', '9.2.0', '9.3.0', '9.4.0', '9.5.0'
126133
];
127134
exports.MYSQL_ARCH_SUPPORT = {
128135
darwin: {
129-
arm64: '8.0.26 - 9.4.0',
130-
x64: '5.7.19 - 9.4.0'
136+
arm64: '8.0.26 - 9.5.0',
137+
x64: '5.7.19 - 9.5.0'
131138
},
132139
linux: {
133-
arm64: '8.0.31 - 9.4.0',
134-
x64: '5.7.19 - 9.4.0'
140+
arm64: '8.0.31 - 9.5.0',
141+
x64: '5.7.19 - 9.5.0'
135142
},
136143
win32: {
137-
x64: '5.7.19 - 9.4.0'
144+
x64: '5.7.19 - 9.5.0'
138145
}
139146
};
140147
exports.MYSQL_MIN_OS_SUPPORT = {
@@ -154,7 +161,7 @@ exports.MYSQL_MIN_OS_SUPPORT = {
154161
'8.0.28 - 8.0.31': '20.0.0',
155162
'8.0.32 - 8.0.34': '21.0.0',
156163
'8.0.35 - 8.0.39 || 8.1.0 - 8.4.2 || 9.0.1': '22.0.0',
157-
'8.0.40 - 8.0.43 || 8.4.3 - 8.4.6 || 9.1.0 - 9.4.0': '23.0.0'
164+
'8.0.40 - 8.0.44 || 8.4.3 - 8.4.7 || 9.1.0 - 9.5.0': '23.0.0'
158165
}
159166
};
160167
exports.DMR_MYSQL_VERSIONS = '8.0.0 - 8.0.2';
@@ -169,7 +176,7 @@ exports.MYSQL_MACOS_VERSIONS_IN_FILENAME = {
169176
'8.0.30 - 8.0.31': 'macos12',
170177
'8.0.32 - 8.0.35 || 8.1.0 - 8.2.0': 'macos13',
171178
'8.0.36 - 8.0.40 || 8.3.0 - 8.4.3 || 9.0.1 - 9.1.0': 'macos14',
172-
'8.0.41 - 8.0.43 || 8.4.4 - 8.4.6 || 9.2.0 - 9.4.0': 'macos15'
179+
'8.0.41 - 8.0.44 || 8.4.4 - 8.4.7 || 9.2.0 - 9.5.0': 'macos15'
173180
};
174181
exports.MYSQL_LINUX_GLIBC_VERSIONS = {
175182
//8.0.42 - 8.0.43, 8.4.5 - 8.4.6, and 9.3.0 - 9.4.0 with glibc 2.28 does NOT have a minimal install version for x64 but it DOES have arm64 support.
@@ -178,28 +185,28 @@ exports.MYSQL_LINUX_GLIBC_VERSIONS = {
178185
//Neither glibc versions for the above MySQL versions have an arm64 minimal install.
179186
x64: {
180187
'5.7.19 - 8.0.20': '2.12',
181-
'8.0.21 - 9.4.0': '2.17'
188+
'8.0.21 - 9.5.0': '2.17'
182189
},
183190
arm64: {
184191
'5.7.19 - 8.0.20': '2.12',
185192
'8.0.21 - 8.0.41 || 8.1.0 - 8.4.4 || 9.0.1 - 9.2.0': '2.17',
186-
'8.0.42 - 8.0.43 || 8.4.5 - 8.4.6 || 9.3.0 - 9.4.0': '2.28'
193+
'8.0.42 - 8.0.44 || 8.4.5 - 8.4.7 || 9.3.0 - 9.5.0': '2.28'
187194
}
188195
};
189196
exports.MYSQL_LINUX_MINIMAL_INSTALL_AVAILABLE = {
190197
'5.7.19 - 8.0.15': 'no',
191198
'8.0.16 - 8.0.20': 'no-glibc-tag',
192-
'8.0.21 - 9.4.0': 'glibc-tag'
199+
'8.0.21 - 9.5.0': 'glibc-tag'
193200
};
194-
exports.MYSQL_LINUX_MINIMAL_INSTALL_AVAILABLE_ARM64 = '8.0.33 - 8.0.41 || 8.1.0 - 8.4.4 || 9.0.1 - 9.2.0'; //Not available for < 8.0.33 and 8.0.42 - 8.0.43, 8.4.5 - 8.4.6, and 9.3.0 - 9.4.0
201+
exports.MYSQL_LINUX_MINIMAL_INSTALL_AVAILABLE_ARM64 = '8.0.33 - 8.0.41 || 8.1.0 - 8.4.4 || 9.0.1 - 9.2.0'; //Not available for < 8.0.33 and >=8.0.42 <8.1.0, >=8.4.5 <8.5, and >=9.3.0 <10.0.0
195202
exports.MYSQL_LINUX_FILE_EXTENSIONS = {
196203
x64: {
197204
'5.7.19 - 8.0.11': 'gz',
198-
'8.0.12 - 9.4.0': 'xz'
205+
'8.0.12 - 9.5.0': 'xz'
199206
},
200207
arm64: {
201208
'8.0.31 - 8.0.32': 'gz',
202-
'8.0.33 - 9.4.0': 'xz'
209+
'8.0.33 - 9.5.0': 'xz'
203210
}
204211
};
205212
exports.MYSQL_LINUX_MINIMAL_REBUILD_VERSIONS = '8.0.26';

dist/src/libraries/Downloader.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -292,9 +292,10 @@ function downloadBinary(binaryInfo, options, logger) {
292292
let downloadTries = 0;
293293
let useDownloadsURL = false;
294294
do {
295-
const downloadURL = binaryInfo.hostedByOracle ? `${useDownloadsURL ? constants_1.MySQLCDNDownloadsBaseURL : constants_1.MySQLCDNArchivesBaseURL}${url}` : await getFileDownloadURLRedirect(url);
295+
let downloadURL = 'UNINITIALISED';
296296
try {
297297
downloadTries++;
298+
downloadURL = binaryInfo.hostedByOracle ? `${useDownloadsURL ? constants_1.MySQLCDNDownloadsBaseURL : constants_1.MySQLCDNArchivesBaseURL}${url}` : await getFileDownloadURLRedirect(url);
298299
logger.log(`Starting download for MySQL version ${version} from ${downloadURL}.`);
299300
await downloadFromCDN(downloadURL, archivePath, logger);
300301
logger.log(`Finished downloading MySQL version ${version} from ${downloadURL}. Now starting binary extraction.`);
@@ -361,13 +362,14 @@ function downloadBinary(binaryInfo, options, logger) {
361362
let downloadTries = 0;
362363
let useDownloadsURL = false;
363364
do {
364-
const downloadURL = binaryInfo.hostedByOracle ? `${useDownloadsURL ? constants_1.MySQLCDNDownloadsBaseURL : constants_1.MySQLCDNArchivesBaseURL}${url}` : await getFileDownloadURLRedirect(url);
365+
let downloadURL = 'UNINITIALISED';
365366
const uuid = (0, crypto_1.randomUUID)();
366367
const zipFilepath = `${dirpath}/${uuid}.${fileExtension}`;
367368
logger.log('Binary filepath:', zipFilepath);
368369
const extractedPath = `${dirpath}/${uuid}`;
369370
try {
370371
downloadTries++;
372+
downloadURL = binaryInfo.hostedByOracle ? `${useDownloadsURL ? constants_1.MySQLCDNDownloadsBaseURL : constants_1.MySQLCDNArchivesBaseURL}${url}` : await getFileDownloadURLRedirect(url);
371373
logger.log(`Starting download for MySQL version ${version} from ${downloadURL}.`);
372374
await downloadFromCDN(downloadURL, zipFilepath, logger);
373375
logger.log(`Finished downloading MySQL version ${version} from ${downloadURL}. Now starting binary extraction.`);

0 commit comments

Comments
 (0)