# excel-to-mysql-db

> This module inserts the Excel files uploaded to the server in the database(MySQL)

Latest version **1.0.4** (published 2021-08-19) · 0 weekly downloads

## Install

```sh
npm install excel-to-mysql-db
pnpm add excel-to-mysql-db
yarn add excel-to-mysql-db
bun add excel-to-mysql-db
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.4 |
| Published | 2021-08-19 |
| First published | 2021-08-19 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 8.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Muhammad Reza Marvi |
| Maintainers | muhdrmv |
| Keywords | exceltomysql, excel, mysql, upload, database |

## Links

- npm: https://www.npmjs.com/package/excel-to-mysql-db
- Repository: https://github.com/muhdrmv/excel-to-mysql-db
- Homepage: https://github.com/muhdrmv/excel-to-mysql-db#readme
- Issues: https://github.com/muhdrmv/excel-to-mysql-db/issues
- npm.io page: https://npm.io/package/excel-to-mysql-db

## Dependencies (2)

- [sync-mysql](https://npm.io/package/sync-mysql.md) ^3.0.1
- [read-excel-file](https://npm.io/package/read-excel-file.md) ^5.2.8

## Alternatives

- [@libsql/sqlite3](https://npm.io/package/@libsql/sqlite3.md) — 39.8K weekly downloads
- [@fortemi/core](https://npm.io/package/@fortemi/core.md) — 461 weekly downloads
- [cdb-converter](https://npm.io/package/cdb-converter.md) — 341 weekly downloads
- [@uplo/adapter-prisma](https://npm.io/package/@uplo/adapter-prisma.md) — 75 weekly downloads
- [typeorm-aios](https://npm.io/package/typeorm-aios.md) — 30 weekly downloads

## Recent versions

- 1.0.4 (latest) — 2021-08-19
- 1.0.3 — 2021-08-19
- 1.0.2 — 2021-08-19
- 1.0.1 — 2021-08-19
- 1.0.0 — 2021-08-19

## README

# excel to mysql db

This module converts your Excel file to a specified table in specified database in MYSQL.


## Excel Formats Supported

Supported XLSX Excel format.

## Installation

```sh
npm install excel-to-mysql-db --save
```

## Dependencies

 * sync-mysql
 * read-excel-file
	

## Using

```sh
var excel_to_database_module = require("excel-to-mysql-db");
```

This module needs 3 arguments.

The first one is uploaded file url

```sh 
var uploaded_file_url = "/uploads/file/name.xlsx";
```

The seconed one is table name in database.

```sh
var table_name = 'table name' ;
```

The third one is the connection object.

```sh
var connection_config = {
	host: host name
	user: MYSQL Username,
	password: Password for the above account,
	database: "database name"
};
```

call module:

```sh
excel_to_database_module(uploaded_file_url, table_name, connection_config);
```

## Testing

```sh

git clone https://github.com/muhdrmv/excel-to-mysql-db.git

cd excel-to-mysql-db/

npm i

For details on setting up the module in the project, refer to README.md at the github address .
```sh


## Be Careful

 * The column names of the database table must be exactly the same as the column names of the Excel file (Even if the name of one column is inconsistent, the module does not insert in the database).
 * This module returns the array of errors and if the array.length greater than 0 : it means that the module had an error and the Excel file isn't inserted in the table specified in the database.

---
_Source: https://npm.io/package/excel-to-mysql-db · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
