Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

pg-logical-replication

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pg-logical-replication - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

2

package.json
{
"name": "pg-logical-replication",
"version": "1.0.0",
"version": "1.0.1",
"description": "PostgreSQL Location Replication client - logical WAL replication streaming",

@@ -5,0 +5,0 @@ "keywords": [

@@ -68,8 +68,18 @@ # pg-logical-replication

```javascript
var LogicalReplication = require('../index.js');
/*
* Test progress
* 1. Create logical replication slot with test_decoding output plugin : SELECT * FROM pg_create_logical_replication_slot('test_slot', 'test_decoding');
* 2. Launch nodejs with this file : node test.js
* 3. Modify data of database
*/
var LogicalReplication = require('pg-logical-replication');
var PluginTestDecoding = LogicalReplication.LoadPlugin('output/test_decoding');
var lastLsn = null; // or initialize LSN
//Connection parameter : https://github.com/brianc/node-postgres/wiki/Client#parameters
var connInfo = {};
var stream = (new LogicalReplication({}))
//Initialize with last LSN value
var lastLsn = null;
var stream = (new LogicalReplication(connInfo))
.on('data', function(msg) {

@@ -81,8 +91,8 @@ lastLsn = msg.lsn || lastLsn;

console.log(PluginTestDecoding.parse(log));
//DO SOMETHING. eg) replicate to other dbms(pgsql, mysql, ...)
//TODO: DO SOMETHING. eg) replicate to other dbms(pgsql, mysql, ...)
} catch (e) {
console.log(log, e);
console.trace(log, e);
}
}).on('error', function(err) {
console.log('Error #2', err);
console.trace('Error #2', err);
setTimeout(proc, 1000);

@@ -98,3 +108,3 @@ });

if (err) {
console.log('Logical replication initialize error', err);
console.trace('Logical replication initialize error', err);
setTimeout(proc, 1000);

@@ -101,0 +111,0 @@ }

@@ -7,3 +7,3 @@ /*

*/
var LogicalReplication = require('../index.js'); //TODO: replace
var LogicalReplication = require('../index.js'); //TODO: replace to 'pg-logical-replication'
var PluginTestDecoding = LogicalReplication.LoadPlugin('output/test_decoding');

@@ -10,0 +10,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc