4.1.1 • Published 10 years ago

epf-pg-importer v4.1.1

Weekly downloads
3
License
MIT
Repository
github
Last release
10 years ago

epf-pg-importer

Take parsed Apple iTunes Enterprise Partner Feed data and import it into a PostgreSQL table, using a streaming COPY.

Usage

'use strict';

const parse = require('epf-parser');
const pgImport = require('epf-pg-importer');
const fs = require('fs');
const pg = require('pg');

var client = new pg.Client;
client.connect(err => {
  if (err) throw err;

  console.log('Starting import...');

  fs.createReadStream('/Users/julian/Downloads/itunes20160518/application')
    .pipe(parse((meta, rows) => {
      pgImport({
        client,
        table: 'application',
        meta
      }, (err, copy) => {
        if (err) throw err;

        rows.pipe(copy).on('finish', () => {
          console.log('Done! Disconnecting...');
          client.on('drain', () => client.end());
        });
      });
    }));
  
});

License

MIT

4.1.1

10 years ago

4.1.0

10 years ago

4.0.2

10 years ago

4.0.1

10 years ago

4.0.0

10 years ago

3.0.3

10 years ago

3.0.2

10 years ago

3.0.1

10 years ago

3.0.0

10 years ago

2.0.4

10 years ago

2.0.3

10 years ago

2.0.2

10 years ago

2.0.1

10 years ago

2.0.0

10 years ago

1.0.0

10 years ago