https://github.com/rubenv/mysqltest
MySQL / MariaDB test helper for Go
https://github.com/rubenv/mysqltest
Last synced: 17 days ago
JSON representation
MySQL / MariaDB test helper for Go
- Host: GitHub
- URL: https://github.com/rubenv/mysqltest
- Owner: rubenv
- License: mit
- Created: 2020-01-28T08:55:30.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-01-28T10:16:14.000Z (over 6 years ago)
- Last Synced: 2024-12-30T12:46:38.030Z (over 1 year ago)
- Language: Go
- Size: 29.3 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# mysqltest
> Go library to spawn single-use MySQL / MariaDB servers for unit testing
[](https://github.com/rubenv/mysqltest/actions) [](https://godoc.org/github.com/rubenv/mysqltest)
Spawns a MySQL / MariaDB server with a single database configured. Ideal for unit
tests where you want a clean instance each time. Then clean up afterwards.
Features:
* Starts a clean isolated MySQL / MariaDB database
* Tested on Fedora and Ubuntu
## Usage
In your unit test:
```go
mysql, err := mysqltest.Start()
defer mysql.Stop()
// Do something with mysql.DB (which is a *sql.DB)
```
## License
This library is distributed under the [MIT](LICENSE) license.