1
1
mirror of https://github.com/Fabio286/antares.git synced 2025-06-05 21:59:22 +02:00

feat: drop and truncate tables

This commit is contained in:
2020-12-03 16:15:10 +01:00
parent e6602d1bfa
commit a4122b4eaa
9 changed files with 148 additions and 43 deletions

View File

@ -448,6 +448,28 @@ export class MySQLClient extends AntaresCore {
return await this.raw(sql);
}
/**
* TRUNCATE TABLE
*
* @returns {Array.<Object>} parameters
* @memberof MySQLClient
*/
async truncateTable (params) {
const sql = `TRUNCATE TABLE \`${params.table}\``;
return await this.raw(sql);
}
/**
* DROP TABLE
*
* @returns {Array.<Object>} parameters
* @memberof MySQLClient
*/
async dropTable (params) {
const sql = `DROP TABLE \`${params.table}\``;
return await this.raw(sql);
}
/**
* @returns {String} SQL string
* @memberof MySQLClient