SqlExtensionsAspire 95.2025.1102.1042
dotnet add package SqlExtensionsAspire --version 95.2025.1102.1042
NuGet\Install-Package SqlExtensionsAspire -Version 95.2025.1102.1042
<PackageReference Include="SqlExtensionsAspire" Version="95.2025.1102.1042" />
<PackageVersion Include="SqlExtensionsAspire" Version="95.2025.1102.1042" />
<PackageReference Include="SqlExtensionsAspire" />
paket add SqlExtensionsAspire --version 95.2025.1102.1042
#r "nuget: SqlExtensionsAspire, 95.2025.1102.1042"
#:package SqlExtensionsAspire@95.2025.1102.1042
#addin nuget:?package=SqlExtensionsAspire&version=95.2025.1102.1042
#tool nuget:?package=SqlExtensionsAspire&version=95.2025.1102.1042
SqlExtensionsAspire
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.
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.
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 | Versions 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. |
-
net9.0
- Aspire.Hosting.SqlServer (>= 9.5.0)
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.