You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+12-4Lines changed: 12 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# MySQL Memory Server
2
2
3
-
This package allows you to create ephemeral MySQL databases from JavaScript and/or TypeScript code, great for testing. When creating a new database, if the version selected is not installed on the system, the binary is downloaded from MySQL's CDN (cdn.mysql.com)
3
+
This package allows you to create ephemeral MySQL databases from JavaScript and/or TypeScript code and also the CLI, great for testing, CI, and learning MySQL. When creating a new database, if the version selected is not installed on the system, the binary is downloaded from MySQL's CDN (cdn.mysql.com)
4
4
5
5
You can run multiple MySQL databases with this package at the same time. Each database will use a random free port. The databases will automatically shutdown when the JS runtime process exits. A `stop()` method is also provided to stop each database instance.
6
6
@@ -30,7 +30,7 @@ Requirements for Linux:
30
30
- If using the system installed MySQL server: 8.0.20 and newer
31
31
- If not using the system installed MySQL server: 8.0.39, 8.0.40, 8.1.0, 8.2.0, 8.3.0, 8.4.2, 8.4.3, 9.0.1, 9.1.0
32
32
33
-
## Usage
33
+
## Example Usage - Application Code
34
34
35
35
This package supports both ESM and CJS so you can use import or require.
36
36
@@ -45,7 +45,7 @@ const db = await createDB()
45
45
46
46
//Create a new database with custom options set
47
47
constdb=awaitcreateDB({
48
-
// see Options for the options you can use in this object and their default values
48
+
// see Options below for the options you can use in this object and their default values
49
49
// for example:
50
50
version:'8.4.x'
51
51
})
@@ -73,6 +73,14 @@ await db.stop()
73
73
MySQL database initialization can take some time. If you run into a "Timeout exceeded" error with your tests, the timeout should be extended.
74
74
If using Jest, information about how to do this can be found here: https://jestjs.io/docs/jest-object#jestsettimeouttimeout
75
75
76
+
## Example Usage - CLI
77
+
78
+
```sh
79
+
# Options are added by doing --{optionName} {optionValue}
80
+
# See Options below for the options you can use with this package
0 commit comments