feat: add devcontainer for VS Code and GitHub Codespaces#317
Open
dlevy-msft-sql wants to merge 1 commit intomicrosoft:mainfrom
Open
feat: add devcontainer for VS Code and GitHub Codespaces#317dlevy-msft-sql wants to merge 1 commit intomicrosoft:mainfrom
dlevy-msft-sql wants to merge 1 commit intomicrosoft:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This pull request adds comprehensive development container support for VS Code and GitHub Codespaces, making it easier for contributors to set up a complete development environment with Go and SQL Server pre-configured.
Changes:
- Adds devcontainer configuration with Go 1.24, SQL Server, and pre-installed development tools
- Includes automated setup scripts, helpful aliases, and pre-configured environment variables for integration tests
- Updates README with a Development section explaining how to use the devcontainer
- Adds .dockerignore for optimized container builds
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
.devcontainer/devcontainer.json |
Main devcontainer configuration with VS Code extensions, settings, and environment variables |
.devcontainer/docker-compose.yml |
Orchestrates Go development container with SQL Server 2025 sidecar |
.devcontainer/Dockerfile |
Defines Go 1.24 development image with tools (go-sqlcmd, golangci-lint, delve, etc.) |
.devcontainer/post-create.sh |
Post-creation setup script that downloads dependencies, waits for SQL Server, and creates helpful aliases |
.devcontainer/mssql/setup.sql |
SQL initialization script that creates test database and sample tables |
.devcontainer/README.md |
Comprehensive documentation for using and customizing the devcontainer |
.dockerignore |
Excludes unnecessary files from Docker build context |
README.md |
Adds Development section with quick start guide for devcontainers |
dlevy-msft-sql
added a commit
to dlevy-msft-sql/go-sqlcmd
that referenced
this pull request
Feb 2, 2026
Dockerfile: - Fix image tag format: 1.24-bookworm (not 1-1.24-bookworm) docker-compose.yml: - Add both SA_PASSWORD and MSSQL_SA_PASSWORD for CI compatibility (different SQL Server images use different env vars) post-create.sh: - Add dynamic workspace detection with robust fallback - Handles different clone names (go-sqlcmd, fork names, etc.) setup.sql: - Add TRY/CATCH error handling for contained database operations - Prevents script failure on unsupported SQL Server configurations .dockerignore: - Add .devcontainer/ to reduce build context size Reference: microsoft/go-mssqldb#317
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #317 +/- ##
==========================================
+ Coverage 75.41% 78.46% +3.05%
==========================================
Files 34 34
Lines 6597 6598 +1
==========================================
+ Hits 4975 5177 +202
+ Misses 1335 1139 -196
+ Partials 287 282 -5 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
f0fe189 to
fd4adc7
Compare
fd4adc7 to
71be9dc
Compare
- Go 1.24 with gopls, delve, staticcheck, golangci-lint - SQL Server 2025 (Developer Edition) with health checks - go-sqlcmd installed (uses go-mssqldb - dogfooding!) - Pre-configured VS Code extensions (Go, MSSQL, Copilot, etc.) - Environment variables pre-set for integration tests - Add Development section to README with quick start guide - Add 'Open in Dev Containers' badge to README - Update CI workflow with improved SQL Server readiness checks
71be9dc to
72cdb74
Compare
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
feat: Add devcontainer for VS Code and GitHub Codespaces
Summary
This PR adds a comprehensive development container that makes it easy for anyone to contribute to go-mssqldb. Just open the repo and start coding - SQL Server is ready!
What's Included
How to Use
🖥️ VS Code
go test ./...— SQL Server is ready!☁️ GitHub Codespaces
go test ./...Helpful Aliases
Once inside the container, these aliases are available:
Discoverability
.devcontainerexistsFiles Added
Screenshots
After opening in Dev Container, developers see:
Why This Matters