Add PostgreSQL checkpoint store implementation#45
Conversation
Co-authored-by: JeanMarcMbouma <16613177+JeanMarcMbouma@users.noreply.github.com>
Co-authored-by: JeanMarcMbouma <16613177+JeanMarcMbouma@users.noreply.github.com>
Co-authored-by: JeanMarcMbouma <16613177+JeanMarcMbouma@users.noreply.github.com>
JeanMarcMbouma
left a comment
There was a problem hiding this comment.
@copilot fix the build warnings
There was a problem hiding this comment.
Pull request overview
This PR introduces first-class PostgreSQL support for projection checkpointing by adding a new BbQ.Events.PostgreSql package. The implementation provides a production-ready checkpoint store that mirrors the existing SQL Server implementation's architecture and patterns.
Key Changes:
- New
PostgreSqlProjectionCheckpointStoreimplementingIProjectionCheckpointStorewith atomic upsert operations using PostgreSQL'sINSERT ... ON CONFLICTstatement - Database schema with
bbq_projection_checkpointstable supporting both simple and partitioned projections usingNULLS NOT DISTINCTconstraint (PostgreSQL 15+) - Comprehensive test suite with 19 integration tests using Testcontainers for isolated testing
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/BbQ.Events.PostgreSql/BbQ.Events.PostgreSql.csproj | Package configuration with Npgsql dependency and NuGet metadata |
| src/BbQ.Events.PostgreSql/Checkpointing/PostgreSqlProjectionCheckpointStore.cs | Core checkpoint store implementation using Npgsql for atomic PostgreSQL operations |
| src/BbQ.Events.PostgreSql/Configuration/ServiceCollectionExtensions.cs | DI extension method UsePostgreSqlCheckpoints for service registration |
| src/BbQ.Events.PostgreSql/Schema/CreateCheckpointTable.sql | Database schema with composite primary key and indexes for checkpoint persistence |
| src/BbQ.Events.PostgreSql/README.md | Comprehensive documentation covering installation, usage, architecture, and troubleshooting |
| tests/BbQ.Events.PostgreSql.Tests/BbQ.Events.PostgreSql.Tests.csproj | Test project configuration with Testcontainers.PostgreSql dependency |
| tests/BbQ.Events.PostgreSql.Tests/PostgreSqlProjectionCheckpointStoreTests.cs | Integration tests validating CRUD operations, concurrency, and edge cases |
| tests/BbQ.Events.PostgreSql.Tests/ServiceCollectionExtensionsTests.cs | Unit tests for DI registration and configuration validation |
| Outcome.slnx | Solution file updated to include new projects |
| .github/workflows/publish-postgresql-package.yml | CI/CD workflow for automated NuGet publishing on postgresql-v* tags |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
The PostgreSQL implementation has 0 warnings. Both The 22 warnings in the solution are from pre-existing code in |
Adds first-class PostgreSQL support for projection checkpointing via a new
BbQ.Events.PostgreSqlpackage implementingIProjectionCheckpointStore.Implementation
BbQ.Events.PostgreSqlwith Npgsql dependencyPostgreSqlProjectionCheckpointStoreusingINSERT ... ON CONFLICTfor atomic upsertsbbq_projection_checkpointstable withNULLS NOT DISTINCTconstraint for nullable partition keysUsePostgreSqlCheckpoints(connectionString)for service registrationpostgresql-v*tagsUsage
Schema mirrors SQL Server implementation for consistency. Tests validate concurrent writes, edge cases, and CRUD operations.
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.