项目作者: hamidsamak

项目描述 :
Convert data (tab-separated) from worksheets to SQL (insert and update) queries
高级语言: PHP
项目地址: git://github.com/hamidsamak/data2sql.git
创建时间: 2017-09-26T16:43:47Z
项目社区:https://github.com/hamidsamak/data2sql

开源协议:MIT License

下载


Data 2 SQL

A web-based project for converting tab and comma separated values like worksheets to SQL insert and update queries.

Features

  • Setting column names
  • Skip or ignore selected columns of given data
  • Working with tab-separated values (TSV) and comma-separated values (CSV)
  • Trimming values

Usage

Insert example

  1. 1. Table name (e.g. test)
  2. 2. Column names (first,second,third,skip)
  3. 3. Columns order to skip (leave empty if all columns are necessary, in this case we skip fourth column *skip*)
  4. 4. Data as below:
  5. 1,2,3,A
  6. 4,5,6,B
  7. 7,8,9,C
  8. Result:
  9. INSERT INTO `test` (`first`, `second`, `third`) VALUES ('1', '2', '3');
  10. INSERT INTO `test` (`first`, `second`, `third`) VALUES ('4', '5', '6');
  11. INSERT INTO `test` (`first`, `second`, `third`) VALUES ('7', '8', '9');

Update example

  1. 1. Table name (e.g. test)
  2. 2. Column names (first,second,third,id)
  3. 3. Columns order to skip (leave empty if all columns are necessary)
  4. 4. Data as below:
  5. A,B,C,1
  6. D,E,F,2
  7. G,H,I,3
  8. Result:
  9. UPDATE `test` SET `first` = 'A', `second` = 'B', `third` = 'C' WHERE `id` = '1';
  10. UPDATE `test` SET `first` = 'D', `second` = 'E', `third` = 'F' WHERE `id` = '2';
  11. UPDATE `test` SET `first` = 'G', `second` = 'H', `third` = 'I' WHERE `id` = '3';