CHORE: Create devcontainer for repo#147
Conversation
…n of virtual environment
|
@microsoft-github-policy-service agree company="Microsoft" |
There was a problem hiding this comment.
Pull Request Overview
This pull request establishes a comprehensive Docker-based development environment for the MSSQL Python Driver project using VS Code devcontainer technology. The setup enables developers to quickly spin up a consistent development environment with all necessary dependencies pre-configured.
- Creates a complete devcontainer configuration with Python 3.10, Microsoft ODBC drivers, and development tools
- Implements automated environment setup through post-creation scripts and Docker configuration
- Adds Docker build optimization through comprehensive file exclusion patterns
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 13 comments.
| File | Description |
|---|---|
.dockerignore |
Excludes build artifacts, caches, and IDE files from Docker context |
.devcontainer/Dockerfile |
Defines container with Python 3.10, MSSQL drivers, and development tools |
.devcontainer/devcontainer.json |
Configures VS Code settings, extensions, and container features |
.devcontainer/post-create.sh |
Automates post-container setup including dependencies and virtual environment |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
bewithgaurav
left a comment
There was a problem hiding this comment.
some refactoring & optimization comments
|
@saurabh500 bumping this because it would be nice to have. Are we close on this PR or is it better to start fresh since it has been a while? |
📊 Code Coverage Report
Diff CoverageDiff: main...HEAD, staged and unstaged changesNo lines with coverage information in this diff. 📋 Files Needing Attention📉 Files with overall lowest coverage (click to expand)mssql_python.pybind.logger_bridge.hpp: 58.8%
mssql_python.pybind.logger_bridge.cpp: 59.2%
mssql_python.row.py: 66.2%
mssql_python.pybind.ddbc_bindings.cpp: 69.3%
mssql_python.pybind.ddbc_bindings.h: 69.7%
mssql_python.pybind.connection.connection.cpp: 75.3%
mssql_python.ddbc_bindings.py: 79.6%
mssql_python.pybind.connection.connection_pool.cpp: 79.6%
mssql_python.connection.py: 84.1%
mssql_python.cursor.py: 84.7%🔗 Quick Links
|
|
I've been using an ubuntu devcontainer for mssql-python since some time now, and have some more improvements to this that we can add here cc: @saurabh500 |
…, ARM64 support - Add unixodbc-dev package for ODBC headers (fixes sql.h not found) - Move Python package installation from Dockerfile to post-create.sh - Add ARM64 support: use Azure SQL Edge instead of SQL Server 2025 - Make SQL Server container startup non-fatal (optional) - Fix false success reporting when build fails - Disable CMake auto-configure to prevent duplicate builds - Generate random SA password and store connection string
|
@bewithgaurav all yours. I haven't had the bandwidth to pick this up. |
- Add aliases for both bash and zsh - Persist DB_CONNECTION_STRING to /etc/environment and shell rc files - Improve completion message with quick start commands
Tasks 1, 2, 3: Update profiler, add new profiling points, expand benchmarks Phase 1: Core Infrastructure (COMPLETE) - Add performance_counter.hpp with thread-safe RAII profiling - Integrate profiling submodule into ddbc_bindings.cpp - Port run_profiler.py and profiling_results.md from old branch - Support for enable/disable/get_stats/reset via Python API Phase 2: Documentation (COMPLETE) - PROFILER_SUMMARY.md: Executive summary and quick reference - PERF_TIMER_LOCATIONS.md: All 43 timer locations with code snippets - ENHANCED_PROFILING_PLAN.md: New profiling points and benchmarks - PROFILER_UPGRADE_STATUS.md: Status tracker and phases Phase 3: Implementation (TODO) - 43 PERF_TIMER calls need to be added (documented in detail) - New profiling points for types, transactions, pool, memory - Comprehensive benchmark suite (8 new categories) Key Features: - Platform detection (Windows/Linux/macOS) - Per-function timing with min/max/avg - Granular timers for construct_rows bottleneck - Designed for Windows vs Linux performance analysis Reference PR: #147 (original profiler branch) Based on analysis showing 2.3x Linux slowdown (now 16% after optimizations)
Devcontainer: Production-Ready Setup for mssql-python Development
Summary
Refactored the devcontainer with battle-tested improvements from local development use. This provides a complete, zero-config development environment for GitHub Codespaces and local devcontainers.
What's New
🏗️ Build & Setup
unixodbc-devpackage - fixessql.h not foundcompilation errors🖥️ ARM64 Support
🔌 SQL Server Auto-Setup
DB_CONNECTION_STRINGenvironment variable (persisted to/etc/environment,.bashrc,.zshrc)⚡ Developer Experience
build- Rebuild C++ extensiontest- Run pytestQuick Start
python main.py- test connectiontest- run all testsTesting
Fixes #146