SpDev.Runtime 0.2.0

dotnet add package SpDev.Runtime --version 0.2.0
                    
NuGet\Install-Package SpDev.Runtime -Version 0.2.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="SpDev.Runtime" Version="0.2.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SpDev.Runtime" Version="0.2.0" />
                    
Directory.Packages.props
<PackageReference Include="SpDev.Runtime" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add SpDev.Runtime --version 0.2.0
                    
#r "nuget: SpDev.Runtime, 0.2.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package SpDev.Runtime@0.2.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=SpDev.Runtime&version=0.2.0
                    
Install as a Cake Addin
#tool nuget:?package=SpDev.Runtime&version=0.2.0
                    
Install as a Cake Tool

SpDev — Stored Procedure Development Environment for .NET

Debug SQL Server stored procedures like regular code. Edit locally, trace variables, step through execution.

SpDev intercepts EXEC statements in your .NET application, executes local .sql files instead of database procedures, and streams variable traces to VS Code for step-through debugging.

Quick Start

# Install the NuGet package
dotnet add package SpDev.Runtime

# Configure in Program.cs
builder.Services.AddSpDev(options =>
{
    options.Enabled = builder.Environment.IsDevelopment();
    options.ProcedureDirectory = "./Procedures";
    options.ConnectionString = builder.Configuration.GetConnectionString("Default");
});

# Register the interceptor with EF Core
builder.Services.AddDbContext<AppDbContext>(options =>
{
    options.UseSqlServer(connectionString);
    options.UseSpDev(builder.Services.BuildServiceProvider());
});

Create a local procedure file ./Procedures/GetCustomerOrders.sql:

CREATE PROCEDURE GetCustomerOrders
    @CustomerId INT
AS
BEGIN
    DECLARE @CustomerName NVARCHAR(100)
    DECLARE @OrderCount INT
    
    SELECT @CustomerName = Name FROM Customers WHERE CustomerId = @CustomerId
    SELECT @OrderCount = COUNT(*) FROM Orders WHERE CustomerId = @CustomerId
    
    SELECT * FROM Orders WHERE CustomerId = @CustomerId
END

Install the VS Code extension, open the .sql file, press F5, and debug.

Features

  • Local File Execution: Edit stored procedures as .sql files in your project directory
  • Variable Tracing: See variable values at each statement execution
  • Step-Through Debugging: F10 to step, F5 to continue, Shift+F5 to stop
  • Zero Production Impact: Enabled = false by default, no overhead when disabled
  • Sync Status: See which procedures have drifted from the database version
  • CodeLens: "▶ Debug" button above CREATE PROCEDURE statements

Architecture

.NET Application → SpDev.Runtime → SQL Server
                      ↓
              Trace Events (HTTP)
                      ↓
              VS Code Extension
                      ↓
              Debug UI (Variables, Line Highlight)

Documentation

Requirements

  • .NET 8 SDK
  • SQL Server 2019+ or Azure SQL Database
  • VS Code 1.90+
  • Node.js 18+ (for extension development)

Sample

See samples/SqlServerApi for a complete working example.

Limitations

  • SQL Server only (no PostgreSQL, MySQL, SQLite)
  • No nested procedure debugging (v0.2 scope)
  • No dynamic SQL tracing (EXEC(@sql))
  • No cross-database procedure calls
  • No encrypted procedure support

See docs/limitations.md for full details.

License

MIT — See LICENSE

Contributing

Contributions welcome. Open an issue or PR on GitHub.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.2.0 89 5/31/2026
0.1.1 86 5/31/2026
0.1.0 92 5/31/2026