Thank you for your interest in contributing to go-sqlcmd! This document provides guidelines for contributing to the project.
- Go 1.24 or later
- Git
# Clone the repository
git clone https://github.com/microsoft/go-sqlcmd.git
cd go-sqlcmd
# Build sqlcmd
./build/build.sh # Linux/macOS
.\build\build.cmd # Windows# Run all tests
go test ./...
# Run tests with verbose output
go test -v ./...
# Run tests for a specific package
go test -v ./pkg/sqlcmd/...This project uses Release Please for automated version management and releases. Release Please analyzes commits since the last release and automatically creates a Release PR that:
- Bumps the version based on Conventional Commits
- Updates the CHANGELOG.md with changes
- Creates a GitHub release when the PR is merged
All commits should follow the Conventional Commits specification. This enables automated version bumping and changelog generation.
<type>[optional scope]: <description>
[optional body]
[optional footer(s)]
| Type | Version Bump | Description | Example |
|---|---|---|---|
feat: |
Minor (0.X.0) | New feature | feat: add query timeout option |
fix: |
Patch (0.0.X) | Bug fix | fix: resolve connection timeout issue |
feat!: or BREAKING CHANGE: |
Major (X.0.0) | Breaking change | feat!: change default port to 1433 |
docs: |
No bump | Documentation only | docs: update README with examples |
chore: |
No bump | Maintenance tasks | chore: update dependencies |
ci: |
No bump | CI/CD changes | ci: add workflow for linting |
test: |
No bump | Test changes | test: add unit tests for parser |
refactor: |
No bump | Code refactoring | refactor: simplify connection logic |
perf: |
No bump | Performance improvements | perf: optimize query execution |
build: |
No bump | Build system changes | build: update build script |
Feature (Minor bump):
feat: add support for Azure AD authentication
Adds new authentication method for connecting to Azure SQL
databases using Azure Active Directory credentials.
Bug fix (Patch bump):
fix: correct handling of null values in output
Previously, null values were displayed as empty strings.
Now they are properly displayed as "NULL".
Breaking change (Major bump):
feat!: change default encryption to mandatory
BREAKING CHANGE: The default encryption setting has changed
from optional to mandatory. Users must explicitly set
encryption to optional if needed.
Non-version-bumping changes:
docs: add examples for container commands
chore: update go-mssqldb dependency
ci: add codeql security scanning
test: add integration tests for query command
- Make changes following conventional commit guidelines
- Create PR with your changes
- Merge PR to main - Release Please will analyze commits
- Release Please creates/updates a Release PR that:
- Bumps version in relevant files
- Updates CHANGELOG.md
- Review and merge the Release PR - This triggers:
- Creation of a git tag for the new version
- Creation of a GitHub Release
- Publishing of release artifacts
If you need to create a release manually:
- Update the version in
.release-please-manifest.json - Update CHANGELOG.md manually
- Create and push a git tag:
git tag v1.0.0 git push origin v1.0.0
- Create a GitHub release from the tag
- Follow the conventional commit format in PR titles
- Keep PRs focused on a single feature or fix
- Add tests for new functionality
- Ensure all tests pass locally before submitting
- Update documentation if needed
- Follow standard Go conventions and idioms
- Use
gofmtfor formatting - Run
golangci-lintbefore submitting
If you have questions, feel free to:
- Open an issue for discussion
- Check existing issues and discussions
- Review the README for more information
By contributing, you agree that your contributions will be licensed under the MIT License.