Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,7 @@
"enableREQueryAndSortCriteria": true,
"relationships": {
"entityNameSeparator": "."
},
"checkAwsCredentials": true
}
}
},
"description": "Hackolade plugin for Amazon DocumentDB",
Expand Down
49 changes: 44 additions & 5 deletions reverse_engineering/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,21 +39,60 @@ module.exports = {
}
},

async getDbCollectionsNames(connectionInfo, logger, cb, app) {
const sshService = app.require('@hackolade/ssh-service');

async validateConnection(connectionInfo, logger, cb) {
const log = createLogger({
title: 'Retrieving databases and collections information',
title: 'Validate connection',
hiddenKeys: connectionInfo.hiddenKeys,
logger,
});

try {
logger.clear();

log.info(getSystemInfo(connectionInfo.appVersion));
log.info(connectionInfo, 'connectionInfo');

const docDbClientInstance = await getDocDbClientInstance({
connectionInfo: {
...connectionInfo,
...parseHost(connectionInfo.host, log),
},
logger: log,
});

log.info('Getting cluster information');

try {
const cluster = await docDbClientInstance.getCluster();
if (!cluster) {
return cb(null, "Cluster doesn't exist in the chosen region.");
}
} catch (err) {
return cb(null, err);
}

log.info('Cluster information retrieved successfully');

cb();
} catch (error) {
log.error(error);

return cb({
message: error.message,
stack: error.stack,
});
}
},

async getDbCollectionsNames(connectionInfo, logger, cb, app) {
const sshService = app.require('@hackolade/ssh-service');

const log = createLogger({
title: 'Retrieving databases and collections information',
hiddenKeys: connectionInfo.hiddenKeys,
logger,
});

try {
await getDocDbClientInstance({
connectionInfo: {
...connectionInfo,
Expand Down