Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/peterfox/waitformysql
A mini golang util for waiting for a mysql database to be up
https://github.com/peterfox/waitformysql
Last synced: 5 days ago
JSON representation
A mini golang util for waiting for a mysql database to be up
- Host: GitHub
- URL: https://github.com/peterfox/waitformysql
- Owner: peterfox
- Created: 2019-04-04T19:48:19.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2021-09-01T17:39:32.000Z (about 3 years ago)
- Last Synced: 2024-10-12T11:34:36.357Z (about 1 month ago)
- Language: Go
- Size: 2.93 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
Awesome Lists containing this project
README
[![Build Status](https://travis-ci.com/peterfox/waitformysql.svg?token=sykMyWNtTgYgm3dx9GKK&branch=master)](https://travis-ci.com/peterfox/waitformysql)
# WaitForMySQL
A simple command-line tool for blocking scripts from running
until a connection is established or a timeout is reached.This tool was designed to be used in build scripts for things
like Travis CI where I was often running into problems with the MySQL
docker container command completing before the new database was ready.
This meant further steps failed and I kept having to add more time to
the build by using the sleep command. Eventually I decided to make this.
I now use it to block the build process until the database is ready
or an appropriate amount of time has passed.## Usage
CLI usage is pretty simple as set out below. You only need specify
the password currently.```
-database string
database name
-host string
database host (default "127.0.0.1")
-password string
database password
-port string
database port (default "3306")
-timeout duration
max timeout in seconds (default 25s)
-username string
database username (default "root")
```## Building
A make file is included. You should be able to simply run `make` to
build the binaries for macOS, Linux and Windows.