diff --git a/README.md b/README.md index 2171efb288..db45fe3ef5 100644 --- a/README.md +++ b/README.md @@ -74,7 +74,7 @@ Powered by popular node packages : ([express](https://github.com/expressjs/expre * Group By, Having (as a separate API) :fire::fire: * Multiple group by in one API :fire::fire: * Chart API for numeric column :fire::fire: -* Prototyping (features available with ONLY local MySql server) +* Prototyping (features available when using local MySql server only) * Run dynamic queries :fire::fire::fire: * Upload single file * Upload multiple files @@ -552,7 +552,7 @@ _fields in Chart API can only take numeric column as its argument. Dynamic queries on a database can be run by POST method to URL localhost:3000/dynamic -This is enabled only when using local mysql server i.e -h localhost or -h 127.0.0.1 option. +This is enabled **ONLY when using local mysql server** i.e -h localhost or -h 127.0.0.1 option. Post body takes two fields : query and params. diff --git a/lib/util/cmd.helper.js b/lib/util/cmd.helper.js index 7c2e54a1de..a5e086e6ab 100644 --- a/lib/util/cmd.helper.js +++ b/lib/util/cmd.helper.js @@ -12,12 +12,13 @@ program.on('--help', () => { program .version('0.2.5') - .option('-h, --host ', 'hostname') - .option('-d, --database ', 'database schema name') + .option('-h, --host ', 'hostname / localhost by default') .option('-u, --user ', 'username of database / root by default') .option('-p, --password ', 'password of database / empty by default') - .option('-n, --portNumber ', 'port number / 3000 by default') + .option('-d, --database ', 'database schema name') + .option('-n, --portNumber ', 'port number for app / 3000 by default') .option('-s, --storageFolder ', 'storage folder / current working dir by default / available only with local') + .option('-i, --ignoreTables ', 'comma separated table names to ignore',list) .parse(process.argv) @@ -52,6 +53,14 @@ exports.handle = program => { program.host = program.host || 'localhost'; program.storageFolder = program.storageFolder || process.cwd() + if (program.ignoreTables) { + let ignoreTables = program.ignoreTables.split(',') + program.ignoreTables = {} + for (var i = 0; i < ignoreTables.length; ++i) { + program.ignoreTables[ignoreTables[i]] = ignoreTables[i]; + } + } + program.connectionLimit = 10; if (program.host === 'localhost' || program.host === '127.0.0.1' || program.host === '::1') {