address-matcher
A package to link two database tables by addresses
Last updated 3 years ago by meena.hoda .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install address-matcher 
SYNC missed versions from official npm registry.

address-matcher

JavaScript Style Guide license

A package to link two database tables by addresses

Usage

const addressMatch = require('address-matcher')

addressMatch(
    {
     source: {
       schema: 'link_test',
       table: 'food',
       id: 'food_id',
       type: 'bigint'
     },
     target: {
       schema: 'link_test',
       table: 'addressbase',
       id: 'address_id',
       type: 'bigint'
     },
     link: {
       schema: 'link_test_results',
       table: 'food_addressbase',
       map: {
         postcode: {
           source: 'postcode',
           target: 'postcode'
         },
         businessName: {
           source: ['business_name', 'address_line_1'],
           target: ['organisation_name', 'organisation', 'building_name']
         }
       }
     }
    }, 
    client, 
    (err) => {
        // Callback
    }
)

The package will look at the options and try to match the records from the source table to the records from the target table and assign the id's given in the options to the link table.
The package currently matches on postcode and business name where the column names are indicated in the options provided.

Install

$ npm install address-matcher --save

This package requires the database to have the "fuzzystrmatch" extension for Postgres which is achieved by:

CREATE EXTENSION "fuzzystrmatch";

License

MIT

Current Tags

  • 0.0.2                                ...           latest (3 years ago)

2 Versions

  • 0.0.2                                ...           3 years ago
  • 0.0.1                                ...           3 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 1
Last Month 1
Dependencies (2)
Dev Dependencies (4)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |