Skip to content

iGLOO-be/geopostcodes-sequelize-import

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

52 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

geopostcodes-sequelize-import

Build Status

Import geopostcode.com streets file into SQL database with Sequelize.

Installation

$ npm install geopostcodes-sequelize-import

Example Usage

var fs = require('fs');
var importerFactory = require('geopostcodes-sequelize-import');
var importer = importerFactory(sequelize, {
  // options
});

var csvFilePath = 'path/to/geopostcodes-streets-plus.csv';
var csvStream = fs.createReadStream(csvFilePath);

importer.syncStream(csvStream, function (err) {
  if (err) {
    throw err;
  }
  console.log('Sync end!');
});

Options

  • maxBulkCreate : (default: 500) Maximum records processed per insert into.
  • updateOnDuplicate : (default: false) See sequelize doc. Only supported by mysql & mariadb If false, duplicate ID errors can be raised if database is already populated.

About

Import geopostcodes.com CSV into SQL databases with Sequelize.js

Resources

License

Stars

Watchers

Forks

Packages

No packages published