This package has been deprecated

Author message:

WE'VE MOVED PG-DELTA-FILE TO @wmfs/pg-delta-file PLEASE USE THAT INSTEAD!

pg-delta-file

0.0.6 • Public • Published

pg-delta-file

JavaScript Style Guide license

Outputs change-only-update CSV files (or “delta” files) that contain all the necessary actions required to re-synchronize rows in a cloned table.

Usage

const generateDeltaFile = require('pg-delta-file')

generateDeltaFiles(
  since: '2017-07-16T20:37:26.847Z',
  outputFilepath: '/some/temp/dir/people-delta.csv',   
  actionAliases: {
    insert: 'u',
    update: 'u',
    delete: 'd'
  },
  createdColumnName: '_created',
  modifiedColumnName: '_modified',

  tables: [
    {
      tableName: 'people',
      csvColumns: [
        'PERSON', // Just output a literal
        '$ACTION', // Will output 'u' or 'd'
        '$ROW_NUM', // Row counter
        '@social_security_id', /// Column data
        '@first_name',
        '@last_name',
        '@age'    
      ] 
    }
  ],
  
  // Standard callback
  function (err, info) {
    // ...
  }
)

Install

$ npm install pg-delta-file --save

License

MIT

Readme

Keywords

Package Sidebar

Install

npm i pg-delta-file

Weekly Downloads

0

Version

0.0.6

License

MIT

Unpacked Size

12.4 kB

Total Files

10

Last publish

Collaborators

  • timneedham