feat: add devcontainer for VS Code and GitHub Codespaces#317
Merged
dlevy-msft-sql merged 3 commits intoApr 22, 2026
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
71be9dc to
72cdb74
Compare
334536f to
c3aa7fe
Compare
74d9f03 to
fcec691
Compare
shueybubbles
approved these changes
Apr 21, 2026
cea0103 to
642a705
Compare
- Add .devcontainer with Go 1.25, SQL Server 2025 sidecar, and pre-configured VS Code extensions (Go, MSSQL, Docker, Copilot, GitLens) legacy ODBC sqlcmd available via sql-odbc alias or full path - Add .dockerignore, post-create setup script, and mssql/setup.sql - Add helpful shell aliases: gtest, gtest-unit, sql, sql-odbc, etc. - Pre-configure environment variables for integration tests (HOST, SQLUSER, SQLPASSWORD, DATABASE, SQLSERVER_DSN) - Add devcontainer README with quick start, troubleshooting, and customization - Update main README with devcontainer quick start section - Fix namedpipe build for non-Windows platforms; add ARM64 npipe support - Fix minor test and type issues for broader compatibility
- Replace bash aliases (sql, sql-odbc, test-db) with executable scripts in ~/bin/ so they work in any terminal type, not just interactive bash - Set up a go-sqlcmd context (devcontainer) during post-create so sqlcmd auto-connects to the local SQL Server without -S/-U/-P flags - Make sql a plain pass-through to go-sqlcmd so all subcommands work (sql query, sql create, sql --version, etc.) - Update devcontainer README to reflect scripts vs aliases and context-based connection
1ce367d to
7ea9a79
Compare
Hardcode the development SA password in mssql.connections and
go.testEnvVars. The MSSQL extension strips passwords set via
variable substitution (${env:}, ${containerEnv:}), so the
password must be a literal value in settings.
7ea9a79 to
ae12aa5
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