User Story
As a developer using SQLite with Pulse, I want an IIdempotencyStore backed by SQLite, so that I can enforce idempotency in embedded, edge, or test scenarios without requiring a full database server.
Background
Mirrors the SQL Server (#227) and PostgreSQL (#228) implementations but uses Microsoft.Data.Sqlite and SQLite-specific DDL (TEXT for ISO-8601 timestamps, INSERT OR IGNORE).
Requirements
- Add
src/NetEvolve.Pulse.SQLite/Scripts/002_CreateIdempotencyKeyTable.sql:
CREATE TABLE IF NOT EXISTS "{table}" ("IdempotencyKey" TEXT NOT NULL PRIMARY KEY, "CreatedAt" TEXT NOT NULL) using ISO-8601 strings for DateTimeOffset.
- Create
SQLiteIdempotencyKeyOptions: ConnectionString, TableName, EnableWalMode, TimeToLive?.
- Implement
SQLiteIdempotencyStore : IIdempotencyStore via Microsoft.Data.Sqlite:
ExistsAsync: SELECT 1 FROM "..." WHERE "IdempotencyKey" = @key LIMIT 1.
StoreAsync: INSERT OR IGNORE INTO "..." VALUES (@key, @createdAt).
- Expose
AddSQLiteIdempotencyStore extension overloads in SQLiteIdempotencyMediatorBuilderExtensions.
Acceptance Criteria
Dependencies
User Story
As a developer using SQLite with Pulse, I want an
IIdempotencyStorebacked by SQLite, so that I can enforce idempotency in embedded, edge, or test scenarios without requiring a full database server.Background
Mirrors the SQL Server (#227) and PostgreSQL (#228) implementations but uses
Microsoft.Data.Sqliteand SQLite-specific DDL (TEXTfor ISO-8601 timestamps,INSERT OR IGNORE).Requirements
src/NetEvolve.Pulse.SQLite/Scripts/002_CreateIdempotencyKeyTable.sql:CREATE TABLE IF NOT EXISTS "{table}" ("IdempotencyKey" TEXT NOT NULL PRIMARY KEY, "CreatedAt" TEXT NOT NULL)using ISO-8601 strings forDateTimeOffset.SQLiteIdempotencyKeyOptions:ConnectionString,TableName,EnableWalMode,TimeToLive?.SQLiteIdempotencyStore : IIdempotencyStoreviaMicrosoft.Data.Sqlite:ExistsAsync:SELECT 1 FROM "..." WHERE "IdempotencyKey" = @key LIMIT 1.StoreAsync:INSERT OR IGNORE INTO "..." VALUES (@key, @createdAt).AddSQLiteIdempotencyStoreextension overloads inSQLiteIdempotencyMediatorBuilderExtensions.Acceptance Criteria
ExistsAsyncreturnstruefor an existing key,falsefor a new one, and ignores expired keys whenTimeToLiveis set.StoreAsyncusesINSERT OR IGNOREand does not throw on duplicates.AddSQLiteIdempotencyStoreoverloads registerIIdempotencyStoreasScoped.Dependencies
IdempotencyKeySchemaconstants).