{"id":22998378,"url":"https://github.com/tablelandnetwork/pglogrepl-rust","last_synced_at":"2025-08-14T00:32:07.536Z","repository":{"id":265770796,"uuid":"704620641","full_name":"tablelandnetwork/pglogrepl-rust","owner":"tablelandnetwork","description":"A POC for Postgres logical replication in Rust","archived":false,"fork":false,"pushed_at":"2023-10-26T11:01:44.000Z","size":22,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-12-09T04:33:50.817Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tablelandnetwork.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-10-13T16:54:42.000Z","updated_at":"2024-09-06T20:35:15.000Z","dependencies_parsed_at":"2024-12-01T08:01:31.365Z","dependency_job_id":null,"html_url":"https://github.com/tablelandnetwork/pglogrepl-rust","commit_stats":null,"previous_names":["tablelandnetwork/pglogrepl-rust"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tablelandnetwork%2Fpglogrepl-rust","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tablelandnetwork%2Fpglogrepl-rust/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tablelandnetwork%2Fpglogrepl-rust/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tablelandnetwork%2Fpglogrepl-rust/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tablelandnetwork","download_url":"https://codeload.github.com/tablelandnetwork/pglogrepl-rust/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":229786993,"owners_count":18124014,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-15T06:13:16.499Z","updated_at":"2024-12-15T06:13:17.269Z","avatar_url":"https://github.com/tablelandnetwork.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Postgres Logical Replication\n\n## Overview\n\nThis is a POC to test out Postgres streaming logical replication in Rust using [rust-postgres](https://github.com/sfackler/rust-postgres).\n\nIt requires:\n\n- a running postgres database server.\n- [wal2json](https://github.com/eulerto/wal2json) plugin should be installed.\n- ensure `wal_level` config is set to 'logical' (`ALTER SYSTEM SET wal_level = logical;`)\n\nThis example shows how to:\n\n- create a [publication](https://www.postgresql.org/docs/current/logical-replication-publication.html#LOGICAL-REPLICATION-PUBLICATION)\n- create a [replication slot](https://www.postgresql.org/docs/current/logical-replication-subscription.html#LOGICAL-REPLICATION-SUBSCRIPTION-SLOT)\n- read [protocol](https://www.postgresql.org/docs/current/protocol-replication.html) messages\n- read json encoded WAL updates\n\nCurrently, the example only replicates `insert` statements on the given table. To try it run the following command with your db config:\n\n```rust\nDB_CONF=\"user=postgres password=password host=localhost port=5432 dbname=postgres\" TABLE_NAME=\u003cyour-table-name\u003e cargo run\n```\n\nIt will start replicating every insert transactions on the source database as they arrive by following the Postgres Replication protocol. As soon as receives a new transaction, it replays it in an embeded [duckdb](https://duckdb.org/) database.\n\nThis POC uses [Materialize](https://materialize.com/)'s fork of [rust-postgres](https://github.com/MaterializeInc/rust-postgres) for logical replication protocol implementation.\n\n### Helpful links\n\n- Logical decoding [example](https://github.com/seddonm1/logicaldecoding)\n- Replication issue on `rust-postgres` [repo](https://github.com/sfackler/rust-postgres/issues/116)\n- [Materialize](https://github.com/MaterializeInc/rust-postgres)'s fork of `rust-postgres` with the patches required to support logical decoding\n- Replication [example](https://github.com/debate-map/app/blob/afc6467b6c6c961f7bcc7b7f901f0ff5cd79d440/Packages/app-server-rs/src/pgclient.rs)\n- Instructure's Change data [capture](https://github.com/instructure/jsoncdc)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftablelandnetwork%2Fpglogrepl-rust","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftablelandnetwork%2Fpglogrepl-rust","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftablelandnetwork%2Fpglogrepl-rust/lists"}