feat(sqlserver): add Microsoft SQL Server support #5924
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: go | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| jobs: | |
| build: | |
| strategy: | |
| matrix: | |
| goos: [darwin, linux, windows] | |
| goarch: [amd64, arm64] | |
| name: build ${{ matrix.goos }}/${{ matrix.goarch }} | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-go@v6 | |
| with: | |
| go-version: '1.25.0' | |
| - run: go build ./... | |
| env: | |
| CGO_ENABLED: "0" | |
| GOOS: ${{ matrix.goos }} | |
| GOARCH: ${{ matrix.goarch }} | |
| test: | |
| runs-on: ubuntu-24.04 | |
| services: | |
| postgres: | |
| image: postgres:16 | |
| env: | |
| POSTGRES_USER: postgres | |
| POSTGRES_PASSWORD: mysecretpassword | |
| POSTGRES_DB: postgres | |
| ports: | |
| - 5432:5432 | |
| options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 | |
| mysql: | |
| image: mysql:9 | |
| env: | |
| MYSQL_DATABASE: dinotest | |
| MYSQL_ROOT_PASSWORD: mysecretpassword | |
| MYSQL_ROOT_HOST: '%' | |
| ports: | |
| - 3306:3306 | |
| options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=5 | |
| mssql: | |
| image: mcr.microsoft.com/mssql/server:2022-latest | |
| env: | |
| ACCEPT_EULA: Y | |
| MSSQL_SA_PASSWORD: MySecretPassword1! | |
| MSSQL_PID: Developer | |
| ports: | |
| - 1433:1433 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-go@v6 | |
| with: | |
| go-version: '1.25.0' | |
| - name: install gotestsum | |
| run: go install gotest.tools/gotestsum@latest | |
| - name: install sqlc-gen-test | |
| run: go install github.com/sqlc-dev/[email protected] | |
| - name: install test-json-process-plugin | |
| run: go install ./scripts/test-json-process-plugin/ | |
| - name: install ./... | |
| run: go install ./... | |
| env: | |
| CGO_ENABLED: "0" | |
| - name: build internal/endtoend | |
| run: go build ./... | |
| working-directory: internal/endtoend/testdata | |
| env: | |
| CGO_ENABLED: "0" | |
| - name: Wait for databases to be ready | |
| run: | | |
| echo "Waiting for MSSQL..." | |
| for i in {1..60}; do | |
| if nc -z localhost 1433 2>/dev/null; then | |
| echo "MSSQL port is open, waiting for service to be ready..." | |
| sleep 10 | |
| break | |
| fi | |
| echo "Waiting for MSSQL... ($i/60)" | |
| sleep 2 | |
| done | |
| - name: test ./... | |
| run: gotestsum --junitfile junit.xml -- --tags=examples -timeout 20m ./... | |
| if: ${{ matrix.os }} != "windows-2022" | |
| env: | |
| CI_SQLC_PROJECT_ID: ${{ secrets.CI_SQLC_PROJECT_ID }} | |
| CI_SQLC_AUTH_TOKEN: ${{ secrets.CI_SQLC_AUTH_TOKEN }} | |
| SQLC_AUTH_TOKEN: ${{ secrets.CI_SQLC_AUTH_TOKEN }} | |
| CGO_ENABLED: "0" | |
| POSTGRESQL_SERVER_URI: "postgres://postgres:mysecretpassword@localhost:5432/postgres?sslmode=disable" | |
| MYSQL_SERVER_URI: "root:mysecretpassword@tcp(localhost:3306)/dinotest?parseTime=true" | |
| MSSQL_SERVER_URI: "sqlserver://sa:MySecretPassword1!@localhost:1433?database=master" | |
| vuln_check: | |
| runs-on: ubuntu-24.04 | |
| timeout-minutes: 5 | |
| steps: | |
| - uses: golang/govulncheck-action@v1 |