Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@proscom/xlsx-to-database

Package Overview
Dependencies
Maintainers
2
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@proscom/xlsx-to-database

Imports sheets from xlsx file to the database tables

  • 1.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
2
Weekly downloads
 
Created
Source

xlsx-to-database

Cli tool to import sheets from xlsx file to the database tables

Currently supports only PostgreSQL databases via pg. Uses pg-copy-streams for faster inserts. Uses xlsx to parse xlsx files.

Installation:

npm install -g @proscom/xlsx-to-database

Usage:

$ xlsx-to-database \
    -i input.xlsx \
    -d database.json \
    -c
$ xlsx-to-database --help
Options:
  --help          Show help                                            [boolean]
  --version       Show version number                                  [boolean]
  --input, -i     Input xlsx file                            [string] [required]
  --database, -d  Path to database connection configuration file
                                                             [string] [required]
  --tables, -t    Only import specified sheets                           [array]
  --prefix, -p    Prefix is prepended to the sheet name to get table name
                                                          [string] [default: ""]
  --batchSize     Amount of rows per single insert query[number] [default: 1000]
  --drop          Drops and recreates matched tables  [boolean] [default: false]
  --create, -c    Creates tables                      [boolean] [default: false]

Configuration file example for PostgreSQL:

{
  "adapter": "pgsql",
  "host": "127.0.0.1",
  "port": "5432",
  "username": "root",
  "password": "root",
  "database": "test",
  "schema": "test"
}

Configuration file is read via require(), so you can also use a .js file to dynamically generate a configuration. It may be useful in order to read environment variables for example.

FAQs

Package last updated on 17 Mar 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc