SqlExtensionsAspire 95.2025.1102.1042

dotnet add package SqlExtensionsAspire --version 95.2025.1102.1042
                    
NuGet\Install-Package SqlExtensionsAspire -Version 95.2025.1102.1042
                    
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="SqlExtensionsAspire" Version="95.2025.1102.1042" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SqlExtensionsAspire" Version="95.2025.1102.1042" />
                    
Directory.Packages.props
<PackageReference Include="SqlExtensionsAspire" />
                    
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 SqlExtensionsAspire --version 95.2025.1102.1042
                    
#r "nuget: SqlExtensionsAspire, 95.2025.1102.1042"
                    
#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 SqlExtensionsAspire@95.2025.1102.1042
                    
#: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=SqlExtensionsAspire&version=95.2025.1102.1042
                    
Install as a Cake Addin
#tool nuget:?package=SqlExtensionsAspire&version=95.2025.1102.1042
                    
Install as a Cake Tool

SqlExtensionsAspire

NuGet

Extension methods for .NET Aspire SQL Server hosting that add SQL command execution, script execution, and SQLPad integration capabilities.

Features

  • SQL Command Execution: Execute ad-hoc SQL commands
  • SQL Script Execution: Execute SQL scripts with GO batch separators
  • SQLPad Integration: Web-based SQL editor for database management
  • Full Aspire Integration: Seamlessly integrates with .NET Aspire

Installation

Install via NuGet:

dotnet add package SqlExtensionsAspire

Usage

Basic Setup

using SqlExtensionsAspire;

var builder = DistributedApplication.CreateBuilder(args);
var sqlserver = builder.AddSqlServer("sqlserver");
var database = sqlserver.AddDatabase("mydatabase");

SQL Command Execution

var db = sqlserver.AddDatabase("DepEmp")
    .WithSqlCommand("deleteEmployee","delete from Employee", ExecCommandEnum.NonQuery)
    .WithSqlCommand("selectEmployeeCount", "select count(*) from Employee", ExecCommandEnum.Scalar)

See above link with demo for executing commands - there are 2 employees, then, after delete command, there is 0 employee.

https://ignatandrei.github.io/aspireExtensions/images/SqlServerExtensions/video-Execute_SqlCommand-20251102225723.mp4

Recreate Database at initial state with scripts

var db = sqlserver.AddDatabase("DepEmp")
    .WithSqlCommand("deleteEmployee","delete from Employee", ExecCommandEnum.NonQuery) //just for demo
    .WithSqlCommand("selectEmployeeCount", "select count(*) from Employee", ExecCommandEnum.Scalar) //just for demo
    .ExecuteSqlServerScriptsAtStartup(DBFiles.FilesToCreate.ToArray())

See above link with demo for recreate database with scripts whenever you want.

https://ignatandrei.github.io/aspireExtensions/images/SqlServerExtensions/video-Recreate_Database_With_Scripts-20251102225854.mp4

SQLPad Integration

var database = sqlserver.AddDatabase("mydatabase")
    .WithSqlPadViewerForDB(sqlserver);

Requirements

  • .NET 9.0 or later
  • .NET Aspire 9.2.0 or later
  • SQL Server (via Aspire.Hosting.SqlServer)

License

MIT License - see LICENSE.txt for details.

Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  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
95.2025.1102.1042 259 11/2/2025
94.2025.802.1154 175 8/3/2025
93.2025.208.1818 108 8/2/2025

Initial release with SQL command execution, script execution, and SQLPad integration for .NET Aspire.