You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Fix grammar: 'is using' -> 'is to use' in README.md
- Remove unused WORKSPACE_FOLDER variable from post-create.sh
- Make bashrc alias updates idempotent (remove existing block first)
- Only run setup.sql if SQL Server connection succeeded
- Don't print SA password to terminal (reference env var instead)
- Use SA_PASSWORD in addition to MSSQL_SA_PASSWORD for CI consistency
- Use environment variable reference in healthcheck
- Pin Go tools to specific versions for reproducibility:
- gopls@v0.18.1, dlv@v1.24.1, staticcheck@v0.6.1, gotext@v0.22.0
- Improve golangci-lint install security by using versioned tag URL
- Fix docs to match actual behavior (only setup.sql is executed)
- Install legacy ODBC sqlcmd (mssql-tools18) for compatibility testing
- Add sql-legacy alias to easily compare behavior between versions
- Document connecting from host tools (Azure Data Studio, SSMS)
Copy file name to clipboardExpand all lines: .devcontainer/README.md
+44-8Lines changed: 44 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -64,7 +64,8 @@ After the container starts, these aliases are available:
64
64
|`glint`| Run golangci-lint |
65
65
|`ggen`| Run go generate (for translations) |
66
66
|`test-db`| Test database connection |
67
-
|`sql`| Connect to SQL Server interactively |
67
+
|`sql`| Connect to SQL Server (go-sqlcmd) |
68
+
|`sql-legacy`| Connect using legacy ODBC sqlcmd |
68
69
|`rebuild`| Rebuild sqlcmd |
69
70
70
71
## SQL Server Connection
@@ -78,23 +79,58 @@ The SQL Server instance is accessible at:
78
79
79
80
### Using the Built-in sqlcmd
80
81
81
-
The container builds sqlcmd from source and adds it to your PATH:
82
+
The container has **two versions** of sqlcmd available:
83
+
84
+
1.**go-sqlcmd** (this project) - the modern Go-based sqlcmd, built from source at `~/bin/sqlcmd`
85
+
2.**Legacy ODBC sqlcmd** - the classic version from mssql-tools18 at `/opt/mssql-tools18/bin/sqlcmd`
86
+
87
+
Since go-sqlcmd is first in PATH, the `sqlcmd` command runs the modern version. Use the aliases or full paths to choose which version:
82
88
83
89
```bash
84
-
# Using the alias
85
-
sql
90
+
# go-sqlcmd (this project) - default in PATH
91
+
sql # alias for go-sqlcmd with connection args
92
+
sqlcmd -S localhost -U sa -P "$SQLCMDPASSWORD" -C
86
93
87
-
# Or explicitly
88
-
~/bin/sqlcmd -S localhost -U sa -P "SqlCmd@2025!" -C
94
+
# Legacy ODBC sqlcmd (for compatibility testing)
95
+
sql-legacy # alias for legacy sqlcmd with connection args
96
+
/opt/mssql-tools18/bin/sqlcmd -S localhost -U sa -P "$SQLCMDPASSWORD" -C
89
97
90
-
# Run a query
98
+
# Run a query with go-sqlcmd
91
99
sql -Q "SELECT @@VERSION"
100
+
101
+
# Compare behavior between versions
102
+
sql -Q "SELECT 1 AS test"
103
+
sql-legacy -Q "SELECT 1 AS test"
92
104
```
93
105
94
106
### VS Code SQL Extension
95
107
96
108
The MSSQL extension is pre-configured with a connection profile named **"sqlcmd-container"**. Click the SQL Server icon in the Activity Bar to connect.
97
109
110
+
### Connecting from Host Machine Tools
111
+
112
+
The SQL Server port (1433) is forwarded to your host machine, so you can connect using tools installed locally:
113
+
114
+
#### Azure Data Studio
115
+
116
+
1. Open Azure Data Studio on your host machine
117
+
2. Create a new connection:
118
+
- Server: `localhost,1433`
119
+
- Authentication: SQL Login
120
+
- User: `sa`
121
+
- Password: `SqlCmd@2025!`
122
+
- Trust server certificate: Yes
123
+
124
+
#### SQL Server Management Studio (Windows)
125
+
126
+
1. Open SSMS on your Windows host
127
+
2. Connect to Server:
128
+
- Server name: `localhost,1433`
129
+
- Authentication: SQL Server Authentication
130
+
- Login: `sa`
131
+
- Password: `SqlCmd@2025!`
132
+
- Check "Trust server certificate"
133
+
98
134
## Environment Variables
99
135
100
136
The following environment variables are set automatically:
@@ -141,7 +177,7 @@ ginstall
141
177
142
178
### Adding SQL Setup Scripts
143
179
144
-
Place `.sql`files in `.devcontainer/mssql/`to have them executed when the container starts.
180
+
The `setup.sql`script in `.devcontainer/mssql/`is executed automatically when the container starts. To run additional SQL scripts, either add them to `setup.sql` or update `post-create.sh` to execute them explicitly.
Copy file name to clipboardExpand all lines: README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -313,7 +313,7 @@ sqlcmd.exe: error: sqlcmd.exe: '-w 4': Der Wert muss größer als 8 und kleiner
313
313
314
314
### Quick Start with Dev Containers
315
315
316
-
The easiest way to develop and test sqlcmd is using the included [Dev Container](.devcontainer/README.md), which works with:
316
+
The easiest way to develop and test sqlcmd is to use the included [Dev Container](.devcontainer/README.md), which works with:
317
317
318
318
-**VS Code**: Install the [Dev Containers extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers), open this repo, and click "Reopen in Container"
319
319
-**GitHub Codespaces**: Click the "Code" button on GitHub and select "Create codespace"
0 commit comments