Skip to content

Fix float formatting to match ODBC sqlcmd with hybrid approach (decimal notation with scientific fallback) #1214

Fix float formatting to match ODBC sqlcmd with hybrid approach (decimal notation with scientific fallback)

Fix float formatting to match ODBC sqlcmd with hybrid approach (decimal notation with scientific fallback) #1214

Workflow file for this run

name: pr-validation
on:
pull_request:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Setup go
uses: actions/setup-go@v6
with:
go-version: '1.24'
- name: Run tests against Linux SQL
run: |
go version
cd cmd/sqlcmd
go get -d
go build .
export SQLCMDPASSWORD=$(date +%s|sha256sum|base64|head -c 32)
export SQLCMDUSER=sa
docker run -m 2GB -e ACCEPT_EULA=1 -d --name sql2022 -p:1433:1433 -e SA_PASSWORD=$SQLCMDPASSWORD mcr.microsoft.com/mssql/server:2022-latest
echo "Waiting for SQL Server to be ready..."
READY=0
for i in {1..60}; do
if docker exec sql2022 /opt/mssql-tools18/bin/sqlcmd -S localhost -U sa -P "$SQLCMDPASSWORD" -C -Q "SELECT 1" &>/dev/null; then
echo "SQL Server is ready!"
READY=1
break
fi
echo "Attempt $i: SQL Server not ready yet, waiting..."
sleep 2
done
if [ $READY -eq 0 ]; then
echo "ERROR: SQL Server failed to become ready within 2 minutes"
exit 1
fi
cd ../..
go test -v ./...