handlers/db/remove.js (view raw)
1const chalk = require("chalk");
2const S3Client = require("../../libs/s3/client");
3const getS3Config = require("../../libs/s3/getConfig");
4const { splitS3Parts } = require("./_utils");
5
6const removeDb = async params => {
7 const { s3Name, fileName } = splitS3Parts(params["s3Name/fileName"]);
8 const s3Config = getS3Config(s3Name);
9 await S3Client(s3Config).remove(fileName);
10 console.log(
11 chalk.greenBright(`Dump ${fileName} has been removed from ${s3Config.name}`)
12 );
13};
14
15module.exports = removeDb;