Skip to content

A node.js module for generating queries & importing excel file to sql query

Notifications You must be signed in to change notification settings

zeroboo/sheet2sql.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sheet2sql.js

A node module for generating sql from sheet document (xls, xslx, csv...)

Table of Contents

Installation Instructions
Usage
Configuration
Demo
Support
Notes

Installation-instructions

From npm: npm install sheet2sql

Usage

Require module:
const sheet2Sql = require("sheet2sql");

To generating mysql insert queries:
sheet2sql.exportInsert(sqlDialect, sheetFile, config, outputFolder);

  • sqlDialect: currently support postgres
  • sheetFile: path to sheet file
  • config: exporting config, null to use default config
  • outputFolder Folder for generated SQL queries

Configuration

Config object has fields that map a sheet name to this sheet parsing config. { "Sheet1": {} }

SheetConfig {

}

Demo

From root folder, go to demo folder
cd demo Run demo script
node demo.js Query file will be generated from demo/mission.xlsx

Scripts will be generated under sub folder
demo-with-config: run exporter with a configuration
demo-no-config: run exporter with default configuration

Support

Notes

About

A node.js module for generating queries & importing excel file to sql query

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published