0.1.3 • Published 6 years ago

@derherrgammler/sqlimporter v0.1.3

Weekly downloads
1
License
MIT
Repository
github
Last release
6 years ago

SQLImporter for Nodejs

An npm Modul. Node.js Import your *.sql files with multiple sql-statements to your MySQL database.

Installation to Node dependency

  1. Make shure that you have sqlimporter installed locally:
npm i @derherrgammler/sqlimporter
  1. Create *.sql file like my example.sql:
    /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ *\
                        Database Recreation
    \* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */

DROP DATABASE IF EXISTS example;
CREATE DATABASE example;
USE example;

    /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ *\
                        Tabblecreation
    \* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */

CREATE TABLE testtable (
    `row1` CHAR(9) NOT NULL PRIMARY KEY,
    `row2` VARCHAR(255) NOT NULL,
    `row3` INT(11) NOT NULL
);

You have to undertstand that there can be Comments but ONLY multiline comments work aktually. I try to change this that also single line comments cna be used in the file. If you want a new Version with deleting also singleline comments please write a issue in GitHub!

  1. Require and usage:
var sqlimport = require("@derherrgammler/sqlimporter");
var connConfig = {
	host	    : 'localhost',
	user	    : 'root',
	password    : 'root'
};

sqlimport.config(connConfig);
    .importFile("/example.sql");

Authors

License

This project is licensed under the MIT License - see the LICENSE file for details

0.1.3

6 years ago

0.1.0

6 years ago

0.0.5

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago