Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dzy321/docker-mysql-driver
docker mysql driver for unit test
https://github.com/dzy321/docker-mysql-driver
mysql node unit-testing
Last synced: about 16 hours ago
JSON representation
docker mysql driver for unit test
- Host: GitHub
- URL: https://github.com/dzy321/docker-mysql-driver
- Owner: dzy321
- Created: 2017-10-27T08:17:55.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2017-12-04T09:04:38.000Z (almost 7 years ago)
- Last Synced: 2024-08-08T22:17:47.369Z (3 months ago)
- Topics: mysql, node, unit-testing
- Language: JavaScript
- Homepage:
- Size: 47.9 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
docker-mysql-driver
=================[![](https://img.shields.io/npm/v/docker-mysql-driver.svg?style=flat)](https://www.npmjs.com/package/docker-mysql-driver)
## Feature
- auto run mysql in docker
- reinitialize the environment at each start## Usage
- docker pull mysql image (default: mysql:5.6)
### Getting start
```js
const dmd = require('docker-mysql-driver')const mysqlServer = await dmd.start(options)
console.log(
mysqlServer.port, // server port
mysqlServer.rootPwd, // root password
mysqlServer.database, // database name
)mysqlServer.stop()
```### Default Options
```js
{
image: "mysql:5.6", // mysql docker image
port: 0, // host port, 0 for random
rootPwd: "123456", // root password
reuse: true, // reuse container, container will not be delete if enabled
name: 'mysql_test', // container name
database: 'test_db', // database name
dockerConfig: undefined, // you can see: https://github.com/apocas/dockerode
}
```