fix: correct issue with database connection#421
Merged
Conversation
It seems we can't use a connection pool with LogicalReplicationService because it creates the client, and current implementation doesn't allow to customize how clients are created.
Merged
alanrsoares
pushed a commit
that referenced
this pull request
Nov 5, 2025
* feat: log insert event from pg * fix: remove unused port * chore: add `vite-node` to dev dependencies * chore: import pg Pool type for typing * feat: create slot * fix: correct issue with database connection (#421) It seems we can't use a connection pool with LogicalReplicationService because it creates the client, and current implementation doesn't allow to customize how clients are created. * test: add initial tests support and feed service tests * ci: fix issue introduced by last merge * feat: change Docker compose to enable PostgreSQL replication * feat: change Docker compose to setup PostgreSQL replication * feat: add message publisher abstraction with console publisher * feat: improve postgres replication setup This change address specific replication to avoid growing the WAL with data that won't be needed. * chore: change console publisher to serialize to JSON * test: fix bropken publisher unit test * feat: change feed replication service to use a message publisher * test: fix broken feed service unit tests * feat: automatically create slot & publication if needed on start * chore: rename setup publication to ensure publication * chore: remove debug line * feat: support replaying feed posts Replaying can be done by setting REPLAY_POSTS env variable. This implementation doesn't handle potential duplications between the feed table records and the WAL. * chore: change config properties to camel case * chore: simplify feed replication service * chore: update wal timeouts in PostgreSQL config * feat: support publishing new posts to Telegram * feat: add SIGINT and SIGTERM support to main This is required to be container friendly * chore: move fixed service requirements inside feed replication class * feat: add logging support Also removed tests because right now there are no relevant tests. * chore: add info log when a post is published successfully * chore: add config documentation and replay filter settings * feat: support replaying posts starting from a timestamp and hash * feat: throttle Telegram messages to respect API limits * chore: change publisher to use generics --------- Co-authored-by: jeronimoalbi <894299+jeronimoalbi@users.noreply.github.com>
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.
It seems we can't use a connection pool with LogicalReplicationService because it creates the client, and current implementation doesn't allow to customize how clients are created.
This PR also removes the database package because is not needed anymore.