Skip to content

Latest commit

 

History

History
125 lines (90 loc) · 3.83 KB

File metadata and controls

125 lines (90 loc) · 3.83 KB

NetEvolve.Pulse.SQLite

NuGet Version NuGet Downloads License

SQLite persistence provider for the Pulse outbox pattern using plain ADO.NET. Designed for embedded, edge, and CLI scenarios where you need outbox reliability without external infrastructure.

Features

  • Embedded, single-file storage with no server dependency
  • ADO.NET implementation using Microsoft.Data.Sqlite
  • Safe concurrent polling via BEGIN IMMEDIATE transactions
  • Optional Write-Ahead Logging (WAL) for read/write concurrency
  • Outbox management APIs for inspecting, replaying, and cleaning messages
  • Configurable table name and connection string (file or in-memory)

Installation

NuGet Package Manager

Install-Package NetEvolve.Pulse.SQLite

.NET CLI

dotnet add package NetEvolve.Pulse.SQLite

PackageReference

<PackageReference Include="NetEvolve.Pulse.SQLite" />

Quick Start

using NetEvolve.Pulse;
using NetEvolve.Pulse.SQLite;

services.AddPulse(config => config
    .AddOutbox()
    .UseSQLiteOutbox("Data Source=outbox.db"));

Usage

Basic Example

services.AddPulse(config => config
    .AddOutbox()
    .UseSQLiteOutbox(opts =>
    {
        opts.ConnectionString = "Data Source=outbox.db";
        opts.EnableWalMode = true;
    }));

Advanced Example (In-Memory / Custom Table)

services.AddPulse(config => config
    .AddOutbox()
    .UseSQLiteOutbox(opts =>
    {
        opts.ConnectionString = $"Data Source=testdb_{Guid.NewGuid():N};Mode=Memory;Cache=Shared";
        opts.TableName = "OutboxMessage";
        opts.EnableWalMode = false; // WAL unsupported for in-memory
    }));

Configuration

services.AddPulse(config => config
    .AddOutbox()
    .UseSQLiteOutbox(opts =>
    {
        opts.ConnectionString = "Data Source=outbox.db";
        opts.TableName = "OutboxMessage";
        opts.EnableWalMode = true;
        opts.JsonSerializerOptions = new JsonSerializerOptions
        {
            PropertyNamingPolicy = JsonNamingPolicy.CamelCase
        };
    }));

Requirements

  • .NET 8.0 or higher (net8.0, net9.0, net10.0 targets)
  • SQLite database file access or in-memory connection string

Related Packages

Documentation

For complete documentation, please visit the official documentation.

Contributing

Contributions are welcome! Please read the Contributing Guidelines before submitting a pull request.

Support

License

This project is licensed under the MIT License - see the LICENSE file for details.


Note

Made with ❤️ by the NetEvolve Team Visit us at https://www.daily-devops.net for more information about our services and solutions.