Skip to content

Commit afcb3d6

Browse files
committed
Adds db:info command which returns database configuration
1 parent be5b445 commit afcb3d6

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

src/commands/database.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,12 @@ exports.handler = async function (args) {
5353
const query = getCreateDatabaseQuery(sequelize, config, options);
5454

5555
switch (command) {
56+
case 'db:info':
57+
if (config.password !== null) {
58+
config.password = '***';
59+
}
60+
helpers.view.log('Config', config);
61+
break;
5662
case 'db:create':
5763
await sequelize
5864
.query(query, {

src/sequelize.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ yargs
3535
.command('db:seed:undo', 'Deletes data from the database', seedOne)
3636
.command('db:seed:all', 'Run every seeder', seed)
3737
.command('db:seed:undo:all', 'Deletes data from the database', seed)
38+
.command('db:info', 'Return database configuration info', database)
3839
.command('db:create', 'Create database specified by configuration', database)
3940
.command('db:drop', 'Drop database specified by configuration', database)
4041
.command('init', 'Initializes project', init)

0 commit comments

Comments
 (0)