An open API service indexing awesome lists of open source software.

https://github.com/zeroboo/sheet2sql.js

A node.js module for generating queries & importing excel file to sql query
https://github.com/zeroboo/sheet2sql.js

excel javascript mysql node-js node-module nodejs npm-package

Last synced: 3 months ago
JSON representation

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

Awesome Lists containing this project

README

        

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

## Table of Contents
**[Installation Instructions](#installation-instructions)**

**[Usage](#Usage)**

**[Configuration](#Configuration)**

**[Demo](#Demo)**

**[Support](#Support)**

**[Notes](#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