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

feat: contextual option to duplicate tables

This commit is contained in:
2021-07-03 12:27:50 +02:00
parent 61a42d51f5
commit 08d5b1b329
7 changed files with 71 additions and 2 deletions

View File

@ -1243,6 +1243,17 @@ export class MySQLClient extends AntaresCore {
return await this.raw(sql);
}
/**
* DUPLICATE TABLE
*
* @returns {Array.<Object>} parameters
* @memberof MySQLClient
*/
async duplicateTable (params) {
const sql = `CREATE TABLE \`${this._schema}\`.\`${params.table}_copy\` LIKE \`${this._schema}\`.\`${params.table}\``;
return await this.raw(sql);
}
/**
* TRUNCATE TABLE
*