BlazorChat.Server.SqlServer
1.0.3
dotnet add package BlazorChat.Server.SqlServer --version 1.0.3
NuGet\Install-Package BlazorChat.Server.SqlServer -Version 1.0.3
<PackageReference Include="BlazorChat.Server.SqlServer" Version="1.0.3" />
<PackageVersion Include="BlazorChat.Server.SqlServer" Version="1.0.3" />
<PackageReference Include="BlazorChat.Server.SqlServer" />
paket add BlazorChat.Server.SqlServer --version 1.0.3
#r "nuget: BlazorChat.Server.SqlServer, 1.0.3"
#:package BlazorChat.Server.SqlServer@1.0.3
#addin nuget:?package=BlazorChat.Server.SqlServer&version=1.0.3
#tool nuget:?package=BlazorChat.Server.SqlServer&version=1.0.3
BlazorChat.Server.SqlServer
SQL Server persistence provider for BlazorChat.Server.
✨ 30-Day Free Trial — covered by your BlazorChat.Server trial. No additional license needed.
Replaces in-memory storage with SQL Server persistence for messages and reactions. BlazorChat.Server is installed automatically as a dependency.
🚀 Quick Start
dotnet add package BlazorChat.Server.SqlServer
1. Export & Run SQL Scripts
// Export embedded scripts for DBA review
BlazorChatSqlServerScripts.ExportToFolder(@"C:\temp\BlazorChatScripts");
Execute the exported .sql files against your database using SSMS, Azure Data Studio, or sqlcmd.
2. Add Connection String
appsettings.json:
{ "ConnectionStrings": { "BlazorChatDb": "Server=.;Database=BlazorChatDb;Trusted_Connection=true;TrustServerCertificate=true;" } }
3. Update Program.cs
builder.Services.AddPleromaPersistence(options =>
{
options.UseSqlServer(builder.Configuration.GetConnectionString("BlazorChatDb"));
});
using BlazorChat.Server.SqlServer.Extensions;
using DatabaseLibraryMDS;
using DatabaseLibraryMDS.Interfaces;
var dbConnectionString = builder.Configuration.GetConnectionString("BlazorChatDb") ?? throw new InvalidOperationException("ConnectionStrings:BlazorChatDb is missing.");
// Register DatabaseLibraryMDS
builder.Services.AddScoped<ISqlServer, SqlServer>( provider => new SqlServer(dbConnectionString));
// Add BlazorChat with SQL Server persistence
builder.Services.AddBlazorChatSqlServer(builder.Configuration);
// Map the SignalR hub
app.MapBlazorChatHub();
// Or, if using authentication: //
// The hub runs anonymously by default. To require auth, map the hub directly:
app.MapHub<BlazorChat.Server.Hubs.ChatHub>("/chathub").RequireAuthorization();`
## 🎯 Features
- **Persistent Messages** — survive server restarts
- **Emoji Reactions** — per-message reactions with summary aggregation
- **Message Editing & Deletion** — soft-delete with restore
- **Exportable SQL Scripts** — review and customize before deployment
- **Azure SQL Compatible** — works with SQL Server 2016+ and Azure SQL Database
## 📋 Database Schema
All objects live in the `chat` schema:
| Object | Type | Purpose |
|--------|------|---------|
| `chat.Messages` | Table | Message storage with thread, sender, edit/delete tracking |
| `chat.Reactions` | Table | Emoji reactions per message (Latin1_General_100_CI_AS_SC collation) |
| `chat.p_AddMessage` | Stored Proc | Insert a message |
| `chat.p_GetMessages` | Stored Proc | Retrieve messages by thread |
| `chat.p_EditMessage` | Stored Proc | Update message text |
| `chat.p_DeleteMessage` | Stored Proc | Soft-delete a message |
| `chat.p_RestoreMessage` | Stored Proc | Undo a soft-delete |
| `chat.p_ToggleReaction` | Stored Proc | Add/remove an emoji reaction |
| `chat.p_GetReactionSummary` | Stored Proc | Reaction summary by timestamp |
| `chat.p_GetReactionSummaryByMessageId` | Stored Proc | Reaction summary by message ID |
| `chat.p_GetReactionSummaries` | Stored Proc | Batch reaction summaries |
## 📦 Prerequisites
- SQL Server 2016+ or Azure SQL Database
- BlazorChat.Server license (30-day trial included)
## 📜 License
Same commercial license as BlazorChat.Server.
- [Purchase](https://loneworx.com/blazor-chat/pricing)
---
**Copyright (C) 2024-2026 LoneWorx LLC** — [loneworx.com](https://loneworx.com)
| Product | Versions 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 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 is compatible. 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. |
-
net10.0
- BlazorChat.Server (>= 1.0.3)
- DatabaseLibraryMDS (>= 3.0.14)
-
net8.0
- BlazorChat.Server (>= 1.0.3)
- DatabaseLibraryMDS (>= 3.0.14)
-
net9.0
- BlazorChat.Server (>= 1.0.3)
- DatabaseLibraryMDS (>= 3.0.14)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
v1.0.3:
- Fixed: README accuracy — removed non-existent features, corrected table list, updated Program.cs example
v1.0.2:
- Fixed: Emoji reactions replacing each other when multiple different emojis added to the same message
- Fixed: Emoji column collation — uses Latin1_General_100_CI_AS_SC so SQL Server distinguishes emoji code points
- Fixed: Split ToggleReactionAsync into separate DML and SELECT calls to work around ExecuteReaderAsync not reading result sets after INSERT/DELETE
- Added: New stored procedure p_GetReactionSummaryByMessageId for clean summary readback
- Breaking: Existing chat.Reactions table must be dropped and recreated to pick up the new collation (if in production)