geopostcodes-sequelize-import
v1.2.0
Published
Import geopostcodes.com CSV into SQL databases with Sequelize.js
Downloads
20
Readme
geopostcodes-sequelize-import
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 perinsert into
.updateOnDuplicate
: (default:false
) See sequelize doc. Only supported bymysql
&mariadb
Iffalse
, duplicate ID errors can be raised if database is already populated.