Skip to content

Add MySQL database support #20

Add MySQL database support

Add MySQL database support #20

Workflow file for this run

name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.25'
- name: Run CI
run: make ci
- name: Build
run: make build
- name: Smoke test - version
run: ./sql-proxy -version
- name: Smoke test - validate config
run: ./sql-proxy -validate -config testdata/config.ci.yaml
test-mysql:
needs: [test]
runs-on: ubuntu-latest
services:
mysql:
image: mysql:8.0
env:
MYSQL_ROOT_PASSWORD: testpass
MYSQL_DATABASE: testdb
ports:
- 3306:3306
options: >-
--health-cmd="mysqladmin ping -h 127.0.0.1"
--health-interval=10s
--health-timeout=5s
--health-retries=5
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.25'
- name: Run MySQL integration tests
env:
MYSQL_HOST: 127.0.0.1
MYSQL_PORT: 3306
MYSQL_USER: root
MYSQL_PASSWORD: testpass
MYSQL_DATABASE: testdb
run: go test -v -run "MySQL" ./internal/db/
- name: Build
run: go build -o sql-proxy .
- name: Validate MySQL example configs
env:
MYSQL_PASSWORD: testpass
run: |
for f in examples/mysql/*.yaml; do
echo "=== $f ==="
./sql-proxy -validate -config "$f" || exit 1
done