Mostlylucid.Ephemeral.Atoms.Data.Sqlite 3.0.0

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

Mostlylucid.Ephemeral.Atoms.Data.Sqlite

SQLite data storage atom for signal-driven persistence. Provides ACID-compliant key-value storage.

Installation

dotnet add package Mostlylucid.Ephemeral.Atoms.Data.Sqlite

Quick Start

var signals = new SignalSink();

// File-based SQLite
await using var storage = new SqliteDataStorageAtom<string, Order>(
    signals,
    databaseName: "orders",
    dbPath: "./orders.db");

// Or in-memory
await using var memoryStorage = new SqliteDataStorageAtom<string, Order>(
    signals,
    databaseName: "orders");

// Save
await storage.SaveAsync("order-123", new Order { Id = "order-123", Total = 99.99m });

// Load
var order = await storage.LoadAsync("order-123");

Configuration

var config = new SqliteDataStorageConfig
{
    DatabaseName = "orders",
    ConnectionString = "Data Source=./orders.db",
    TableName = "orders",            // Table name in SQLite
    UseWalMode = true,               // WAL for better concurrency
    MaxConcurrency = 1,              // Sequential writes
    EmitCompletionSignals = true,    // Emit saved.data.orders
    JsonOptions = new JsonSerializerOptions
    {
        PropertyNamingPolicy = JsonNamingPolicy.CamelCase
    }
};

await using var storage = new SqliteDataStorageAtom<string, Order>(signals, config);

Signal-Driven Usage

Atom Style

var signals = new SignalSink();
await using var storage = new SqliteDataStorageAtom<string, Order>(signals, "orders", "./orders.db");

// Fire-and-forget save
storage.EnqueueSave("order-123", order);

// React to completion
signals.SignalRaised += signal =>
{
    if (signal.Signal == "saved.data.orders")
        Console.WriteLine($"Order {signal.Key} persisted to SQLite");
};

Attribute Style

[EphemeralJobs(SignalPrefix = "order")]
public class OrderWorkflow
{
    private readonly SqliteDataStorageAtom<string, Order> _storage;

    public OrderWorkflow(SignalSink signals)
    {
        _storage = new SqliteDataStorageAtom<string, Order>(signals, "orders", "./orders.db");
    }

    [EphemeralJob("created")]
    public async Task HandleOrderCreated(SignalEvent signal, Order order)
    {
        await _storage.SaveAsync(order.Id, order);
        // saved.data.orders emitted automatically
    }

    [EphemeralJob("saved.data.orders")]
    public Task OnOrderPersisted(SignalEvent signal)
    {
        Console.WriteLine($"Order {signal.Key} stored in SQLite");
        return Task.CompletedTask;
    }
}

Database Schema

The atom creates a simple key-value table:

CREATE TABLE orders (
    key TEXT PRIMARY KEY NOT NULL,
    value TEXT NOT NULL,           -- JSON-serialized value
    created_at TEXT DEFAULT CURRENT_TIMESTAMP,
    updated_at TEXT DEFAULT CURRENT_TIMESTAMP
);

Additional Methods

// Count entries
long count = await storage.CountAsync();

// List all keys
var keys = await storage.ListKeysAsync();

// Check existence
bool exists = await storage.ExistsAsync("order-123");

// Delete
await storage.DeleteAsync("order-123");

// Clear all
await storage.ClearAsync();

Performance

  • Uses WAL journal mode for concurrent reads during writes
  • Single-writer pattern via EphemeralWorkCoordinator
  • Upsert via INSERT ... ON CONFLICT for atomic save-or-update
  • Lazy initialization on first operation
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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on Mostlylucid.Ephemeral.Atoms.Data.Sqlite:

Package Downloads
mostlylucid.botdetection

Enterprise bot detection and anonymous entity resolution for ASP.NET Core — the detection engine behind StyloBot. Probabilistic and behavioural, not just User-Agent matching: UA/header/IP analysis, JA3/JA4/HTTP2/QUIC/TCP-IP fingerprinting, Leiden cluster discovery, 129-dim Markov session vectors, metastable fingerprint identity, and optional LLM classification. Zero-PII (HMAC-SHA256), SQLite-backed, single-call UseStyloBot() setup.

mostlylucid.ephemeral.complete

Meta-package that references all Mostlylucid.Ephemeral packages - bounded async execution with signals, atoms, and patterns. Install this single package to get everything.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
3.0.0 268 8/21/2026
2.10.0 7,589 7/23/2026
2.9.1 2,162 7/9/2026
2.9.0 223 7/8/2026
2.8.1 134 7/6/2026
2.7.0 131 7/4/2026
2.6.4 166 6/21/2026
2.6.3 164 5/22/2026
2.6.2 164 5/22/2026
2.6.0 164 5/22/2026
2.5.1 155 5/22/2026
2.5.0 142 5/3/2026
2.4.0 146 4/17/2026
2.3.2 159 1/9/2026
2.3.1 157 1/9/2026
2.3.1-alpha0 160 1/9/2026
2.3.0 1,396 1/8/2026
2.3.0-alpha1 151 1/8/2026
2.1.0 157 1/8/2026
2.1.0-preview 145 1/8/2026
Loading failed