()
| 68 | |
| 69 | // Drop All Data, but keep the schema. |
| 70 | async dropData(): Promise<ExecutionResult> { |
| 71 | return new Promise<ExecutionResult>(async (resolve, reject) => { |
| 72 | this.logger.debug('Dropping all data') |
| 73 | try { |
| 74 | const result = await this.generateAxiosRequest({ |
| 75 | path: '/alter', |
| 76 | data: '{"drop_op": "DATA"}', |
| 77 | }) |
| 78 | this.logger.debug(result.data) |
| 79 | this.logger.debug(`${chalk.green('dropData')}: Operation successful.`) |
| 80 | resolve(result) |
| 81 | } catch (error) { |
| 82 | this.logger.error(`${chalk.red('dropData')}: Operation failed.`) |
| 83 | this.logger.debug(JSON.stringify(error)) |
| 84 | reject(error) |
| 85 | } |
| 86 | }) |
| 87 | } |
| 88 | } |
no test coverage detected