1.0.6 • Published 4 years ago

mysqlshell.js v1.0.6

Weekly downloads
16
License
ISC
Repository
github
Last release
4 years ago

mysqlshell.js

简介

使用方法

import { demoDbConfig } from "./appConfig";
import { DbShellHelper } from '../index'
import { DbImportOptions, DbExportOptions } from "../interfaces";

var app = new DbShellHelper();
app.dbServer = demoDbConfig;

// exec sql file demo
function execFile() {
    app.execSqlFile({
        filepath: `${__dirname}/tb_demo.sql`
    })
}
execFile();

// exec sql string demo
function execString() {
    app.execSqlString({
        queryString: 'delete from tb_demo;'
    });
}
execString();

// export table demo. if tables is not set, this will export full database;
function exportDb() {
    let options: DbExportOptions = {
        tables: 'tb_demo',
        filepath: `${__dirname}/tb_demo.sql`
    }
    app.exportDb(options);
}
exportDb();

// import table demo
function importDb() {
    let options: DbImportOptions = {
        filepath: `${__dirname}/tb_demo.sql`
    }
    app.importSqlFile(options)
}
importDb();
1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago