3 const DB
= require('../src/db');
4 const Logger
= require('../src/logger');
5 const Config
= require('../config');
6 const config
= new Config(process
.env
.NODE_ENV
);
8 const logger
= new Logger(config
);
9 const db
= new DB(logger
, config
);
12 const profile
= process
.argv
[2];
13 const scope
= process
.argv
[3];
16 console
.log('missing scope');
17 throw new Error('missing argument');
20 console
.log('missing profile');
21 throw new Error('missing argument');
25 await db
.initialize();
26 await db
.context(async (dbCtx
) => {
27 const result
= await db
.profileScopeInsert(dbCtx
, profile
, scope
);
31 await db
._closeConnection();