Git Product home page Git Product logo

csvtomysql's Introduction

CSV TO MYSQL

  • this is update tool with csv files
  • this is very simple module.
  • if you want update small csv file to mysql, you can use this module
  • this module is tested with 65000 row csv update to mysql, it works very well

Install

npm install -g csvtomysql

How to run

  • global install
./csvtomysql ./config.json
  • local install
./node_modules/.bin/csvtomysql ./config.json

Support features:

  • read csv and update mysql
    • select key columns in csv
    • select key columns in mysql table
  • read csv and insert mysql
  • config file support

Config File Format

  • update config file sample
{
    "host": "localhost",
    "user": "puser",
    "password": "puser",
    "database": "test",
    "csv": "./samples/sample_update.csv",
    "table": "users",
    "mode": "update",
    "keys": ["id","age"]
}
  • insert config file sample
{
    "host": "localhost",
    "user": "puser",
    "password": "puser",
    "database": "test",
    "csv": "./samples/sample_insert.csv",
    "table": "users",
    "mode": "insert"
}
  • format
    • host: DB address
    • user: DB user
    • password: DB password
    • database: database name
    • csv: csv file path
    • table: update table name
    • mod: 'insert' or 'update'
    • keys: update query 'where' keys, this is string array
      • ['id', 'age'] 'update ...... were id = 'csv.id', age = 'csv.age'

csvtomysql's People

Contributors

madfishdt avatar jisueo avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.