Skip to content

Commit db2efe2

Browse files
mention that all values are optional
1 parent fa1b07a commit db2efe2

File tree

1 file changed

+1
-29
lines changed

1 file changed

+1
-29
lines changed

README.md

Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -104,11 +104,9 @@ An object with two properties. ```version``` is the version of MySQL used to cre
104104
The method to stop the database. The returned promise resolves when the database has successfully stopped.
105105

106106
#### Options:
107-
##### For options that are not required, using ```undefined``` as a value will use the option's default value.
107+
##### All options are not required to be set. Using ```undefined``` as a value will use the option's default value.
108108
- `version: string`
109109

110-
Required: No
111-
112110
Default: undefined
113111

114112
Description: Version of MySQL to use for the database. Uses semver for getting the version, so valid semver versions are allowed. For example, `8.x` is a valid version and will use the latest 8.x MySQL version.
@@ -123,32 +121,24 @@ If defined:
123121

124122
- `dbName: string`
125123

126-
Required: No
127-
128124
Default: "dbdata"
129125

130126
Description: The name of the database to create when initializing MySQL. You'd use this name to connect to the database.
131127

132128
- `logLevel: "LOG" | "WARN" | "ERROR"`
133129

134-
Required: No
135-
136130
Default: "ERROR"
137131

138132
Description: Log level for this package. If "ERROR" is used, only errors from this package will show up in the console. If "WARN" is used, warnings and errors from this package will show up in the console. If "LOG" is used, every log from this package will show up in the console.
139133

140134
- `portRetries: number`
141135

142-
Required: No
143-
144136
Default: 10
145137

146138
Description: Number of times to try connecting MySQL to a randomly generated port before giving up. According to the [MySQL Documentation](https://dev.mysql.com/doc/refman/en/server-options.html#option_mysqld_port "MySQL Documentation") if port 0 is used as the MySQL server port, the default value (3306) will be used. To get around this, a random number between 1025 - 65535 (inclusive) is generated and used for the database's port. If MySQL cannot successfully listen on a randomly generated port after `portRetries` then the `createDB()` promise is rejected. A warning is created when MySQL tries connecting to a port that is already in use. This option only applies for the MySQL port if the MySQL port is not explicitly set or if it's set to 0. This option also only applies for the MySQL X port if the MySQL X port is not explicitly set or if it's set to 0.
147139

148140
- `downloadBinaryOnce: boolean`
149141

150-
Required: No
151-
152142
Default: true
153143

154144
Description: If set to true, all versions requested that need to be downloaded from MySQL's CDN will be downloaded once and will stay on the system after the database stops. If set to false, the binaries that need to be downloaded will be downloaded for each database creation and will be deleted when the database is stopped.
@@ -157,64 +147,48 @@ Use `false` to save disk space after the databases have been stopped, or use `tr
157147

158148
- `lockRetries: number`
159149

160-
Required: No
161-
162150
Default: 1,000
163151

164152
Description: If `downloadBinaryOnce` is set to `true`, `lockRetries` is the number of times to check to see if the lock for the binary has been released (meaning it has been successfully downloaded and extracted). If the number of retries exceeds `lockRetries`, the `createDB()` promise gets rejected. This option is also used for the number of times to check to see if the lock for libaio has been released (only on Linux distros that use libaio1t64 instead of libaio1)
165153

166154
- `lockRetryWait: number`
167155

168-
Required: No
169-
170156
Default: 1,000
171157

172158
Description: If `downloadBinaryOnce` is set to `true` and/or on Linux distros that use libaio1t64 instead of libaio1, `lockRetryWait` is the number of milliseconds to wait before checking if the lock has been released.
173159

174160
- `username: string`
175161

176-
Required: No
177-
178162
Default: root
179163

180164
Description: The username of the user that is used to login to the database.
181165

182166
- `port: number`
183167

184-
Required: No
185-
186168
Default: 0
187169

188170
Description: The port that the database will listen on. If set to 0, a randomly generated port is used.
189171

190172
- `xPort: number`
191173

192-
Required: No
193-
194174
Default: 0
195175

196176
Description: The port that the MySQL X Plugin will listen on. If set to 0, a randomly generated port is used.
197177

198178
- `ignoreUnsupportedSystemVersion: boolean`
199179

200-
Required: No
201-
202180
Default: false
203181

204182
Description: This option only applies if the system-installed MySQL version is lower than the oldest supported MySQL version for this package (8.0.20) and the `version` option is not defined. If set to `true`, this package will use the latest version of MySQL instead of the system-installed version. If `false`, the package will throw an error.
205183

206184
- `downloadRetries: number`
207185

208-
Required: No
209-
210186
Default: 3
211187

212188
Description: The number of times to try to download a MySQL binary before giving up and rejecting the `createDB()` promise.
213189

214190
- `initSQLString: string`
215191

216-
Required: No
217-
218192
Default: ""
219193

220194
Description: A string with MySQL queries to run before the database starts to accept connections. This option can be used for things like initialising tables without having to first connect to the database to do that. The queries in the string get executed after ```mysql-memory-server```'s queries run. Uses the ```--init-file``` MySQL server option under the hood. Learn more at the [--init-file MySQL Documentation](https://dev.mysql.com/doc/refman/8.4/en/server-system-variables.html#sysvar_init_file)
@@ -223,8 +197,6 @@ The internal queries that are ran before the queries in ```initSQLString``` are
223197

224198
- `arch: "arm64" | "x64"`
225199

226-
Required: No
227-
228200
Default: process.arch
229201

230202
Description: The MySQL binary architecture to execute. MySQL does not offer server builds for Windows on ARM, so to get this package working on Windows on ARM, set the arch option to "x64" and Windows will emulate MySQL.

0 commit comments

Comments
 (0)