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
@@ -39,6 +58,7 @@ This guide will help you set up your environment, build the native bindings, and
39
58
2.**Install Visual Studio Build Tools**
40
59
- Include the “Desktop development with C++” workload.
41
60
- CMake is included by default.
61
+
-**Alternative for VS Code users:** If you already have VS Code installed, you can configure it for C++ development by following [this guide](https://code.visualstudio.com/docs/cpp/config-msvc).
42
62
3.**Install Microsoft ODBC Driver for SQL Server:**
@@ -168,23 +194,48 @@ The wheel file will be created in the `dist/` directory.
168
194
169
195
## Directory Structure
170
196
171
-
-`pybind/` — Native C++/pybind11 bindings and platform build scripts
197
+
-`mssql_python/pybind/` — Native C++/pybind11 bindings and platform build scripts
172
198
-`mssql_python/` — Python package source
173
199
-`tests/` — Test suite
174
200
-`dist/` — Built wheel packages
175
201
176
202
---
177
203
204
+
## Setting Up a Test Database (Optional)
205
+
206
+
If you don't have access to a SQL Server instance, you can quickly set up a containerized SQL Server using go-sqlcmd:
207
+
208
+
### Windows
209
+
```bash
210
+
# Install Docker Desktop and sqlcmd
211
+
winget install Docker.DockerDesktop
212
+
```
213
+
Configure Docker, accept EULA, etc., then open a new terminal window:
214
+
```bash
215
+
winget install sqlcmd
216
+
```
217
+
Open a new window to get new path variables:
218
+
```bash
219
+
sqlcmd create mssql --name mssql-python --accept-eula tag 2025-latest --using https://github.com/Microsoft/sql-server-samples/releases/download/wide-world-importers-v1.0/WideWorldImporters-Full.bak
220
+
sqlcmd config connection-strings
221
+
```
222
+
Copy the ODBC connection string and remove the driver clause before storing it in your `DB_CONNECTION_STRING` environment variable.
223
+
224
+
### macOS & Linux
225
+
Similar commands are available for macOS and Linux. See the [go-sqlcmd documentation](https://learn.microsoft.com/en-us/sql/tools/sqlcmd/quickstart-sqlcmd-create-container?view=sql-server-ver17) for platform-specific instructions.
226
+
227
+
---
228
+
178
229
## Troubleshooting
179
230
180
231
- Ensure all prerequisites are installed and on your PATH.
181
-
- If a build fails, clean up old artifacts and try again (`pybind/build.bat clean` or `./build.sh clean`).
232
+
- If a build fails, clean up old artifacts and try again (`mssql_python/pybind/build.bat clean` or `./build.sh clean`).
182
233
- For wheel issues, ensure the native binding (`.pyd` or `.so`) is present in the expected location before building the wheel.
183
234
- For test failures, double-check your `DB_CONNECTION_STRING`.
184
235
185
236
---
186
237
187
-
For more details on the native bindings, see [`pybind/README.md`](pybind/README.md).
238
+
For more details on the native bindings, see [`mssql_python/pybind/README.md`](mssql_python/pybind/README.md).
0 commit comments