feat: PostgreSQL ADO.NET implementation of IIdempotencyStore#391
Merged
feat: PostgreSQL ADO.NET implementation of IIdempotencyStore#391
Conversation
6 tasks
Agent-Logs-Url: https://github.com/dailydevops/pulse/sessions/db1dd731-ae20-4ce8-ad2f-c727daa6b4ad Co-authored-by: samtrion <3283596+samtrion@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add IIdempotencyStore implementation for PostgreSQL ADO.NET
feat: PostgreSQL ADO.NET implementation of IIdempotencyStore
Apr 15, 2026
Contributor
|
@copilot Add also Integration tests |
Agent-Logs-Url: https://github.com/dailydevops/pulse/sessions/97fb9629-13b0-4bbc-9f21-936c396614ef Co-authored-by: samtrion <3283596+samtrion@users.noreply.github.com>
Contributor
Author
Added in f9e0cdd:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a PostgreSQL-native
IIdempotencyKeyRepositorybacked by Npgsql ADO.NET, mirroring the existing SQL Server implementation without requiring EF Core.DDL (
Scripts/IdempotencyKey.sql)IdempotencyKeywithidempotency_key VARCHAR(500) PKandcreated_at TIMESTAMP WITH TIME ZONEfn_exists_idempotency_key(key, valid_from?)— TTL-aware existence checkfn_insert_idempotency_key(key, created_at)—INSERT … ON CONFLICT DO NOTHINGfn_delete_expired_idempotency_keys(valid_from)— cleanup helperImplementation
PostgreSqlIdempotencyKeyRepository(internal sealed) — calls the above functions viaNpgsqlCommand; catchesPostgresExceptionwithSqlState == "23505"inStoreAsyncas a safety netPostgreSqlIdempotencyMediatorBuilderExtensions— threeAddPostgreSqlIdempotencyStoreoverloads (connection string, factory, options action) registeringIIdempotencyKeyRepositoryasScopedUsage
Tests
PostgreSqlIdempotencyKeyRepositoryPostgreSqlAdoNetIdempotencyTests) running against a real PostgreSQL container via Testcontainers, covering: key absent, key present, different key, multiple keys, duplicate insert (same scope), cross-scope duplicate insert (exercises the23505catch path), TTL within range, and TTL expired scenarios