db-console v1.0.1
DB Console
The database REPL console for modern node.js app.
Design Philosophy
There isn't a tool in javaScript world which behaves similar to Ruby on Rails'
rails console. This is really a handy feature: opening up an REPL console and
executing some model commands. However, javaScript is more like a split world.
I want to make a generic console tool to hook into different ORM environments.
Install
It's recommended to install this locally to your package.
npm install --save-dev db-consoleAnd add the following to your scripts field in package.json.
"console": "db-console"Configuration
DB Console read configurations from several places.
dbConsolefield inpackage.json- configuration file which default name is
.dbconsolerc - command line arguments
Precedence
Configuration file take precedence over dbConsole field. And command line
arguments have the highest precedence. You can overwrite any configuration with
command line arguments.
Free Format
You can write configuration file in any format you want. If the file doesn't
have extension, DB Console tries to treat it as json, cson or yaml and
load. If the file has extension, supported types include js, json, ts,
coffee, cson and yaml.
Customizable
You can use --config-file to make DB Console load the configuration file you
want. In this case, the default configuration file is ignored.
Options
-h, --helpview db-console's help-v, --versionview db-console's version-c, --config-file stringthe config file to load-H, --history-file stringthe history file to use-o, --orm stringthe orm library of the models-d, --db stringthe database connection url-m, --models string, regexp, [string], [regexp]model files matcher-b, --model-base-directory stringexecuting model files matcher in this directory-p, --prompt stringthe shape of the prompt
Supported ORMs
- mongoose
- sequelize
- sequelize-typescript
- typegoose
- typeorm
License
MIT © Zhang Kai Yu