{"repo":"kibae/pg-logical-replication","free":true,"listed":false,"github":"https://github.com/kibae/pg-logical-replication","clone":"git clone https://github.com/kibae/pg-logical-replication.git","description":"PostgreSQL Logical Replication client for node.js","language":"TypeScript","stars":138,"topics":["postgresql","logical-replication","postgres","cdc","decoderbufs","nodejs","typescript","wal2json","logical-decoding","pgoutput"],"license":"MIT","category":"databases-storage","readme_excerpt":"pg-logical-replication - PostgreSQL Logical Replication client for node.js( =20.0.0 ) - Supported plugins - pgoutput (Native to PostgreSQL, Recommended) - Use the pgoutput plugin to process huge transactions. - wal2json - decoderbufs - test decoding (Not recommended) - Document for old version(1.x) PostgreSQL Versions on Node.js 20, 22, 24, 26 --------------------- -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- PostgreSQL 14 PostgreSQL 15 PostgreSQL 16 PostgreSQL 17 PostgreSQL 18 1. Install - pg-logical-replication depends on pg(node-postgres) = 6.2.2 and eventemitter2 2. Usage - This is an example using wal2json . A replication slot( test slot wal2json ) must be created on the PostgreSQL server. - SELECT FROM pg create logical replication slot('test slot wal2json', 'wal2json') ---- 3. LogicalReplicationService 3-1. Constructor(clientConfig: ClientConfig, config?: Partial ) 3-2. subscribe(plugin: AbstractPlugin, slotName: string, uptoLsn?: string): Promise - Receive changes from the server. - plugin output plugins. - slotName Logical replication slot name. You can create slot via pg create logical replication slot function. - uptoLsn (optional) The starting point of the data to be streamed. 3-3. acknowledge(lsn: string): Promise - After processing the data, it signals the PostgreSQL server that ","default_branch":null,"files":null,"tree":[],"storefront":"/r/kibae","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/kibae/pg-logical-replication/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}