1.6.0 • Published 4 months ago

excel-to-postgres v1.6.0

Weekly downloads
-
License
MIT
Repository
github
Last release
4 months ago

excel-to-postgres

Quickly export an Excel Workbook to a Postgres DB

Installation

Using NPM:

npm i excel-to-postgres

Using Yarn:

yarn add excel-to-postgres

Usage

import { excelToPostgresDb } from 'excel-to-postgres';

excelToPostgresDb({
    host: 'localhost',
    user: 'username',
    password: 'secret',
    port: 5432
    database: 'my_pg_db',
}, '/path/to/file.xlsx',
    {
        createDatabase: true
    });

Options

Supports four options, all of which are optional:

  • createDatabase - true | false (Defaults to false)
  • createTables - true | false (Defaults to false)
  • dropTables - true | false (Defaults to false. When creating table, drop the table if it already exists)
  • generatePrimaryKey - true | false (Defaults to false. Generates 'id' column to be used as a primary key. Cannot be used with 'useExistingPrimaryKeys' option)
  • useExistingPrimaryKeys - true | false (Defaults to false. Supports multiple primary keys. Append '_pk' to the column name in the workbook that will be the primary key. Cannot be used with 'generatePrimaryKey' option)

Testing

This package's tests are written using Jest. To execute, run:

npm test

1.6.0

4 months ago

1.5.3

4 months ago

1.5.2

3 years ago

1.5.1

3 years ago

1.5.0

3 years ago

1.4.1

3 years ago

1.4.0

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago