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

refactor: passing schema from table context options

This commit is contained in:
2021-07-14 18:15:13 +02:00
parent ed6e7fa72d
commit c87b8dc738
7 changed files with 38 additions and 31 deletions

View File

@ -1157,7 +1157,7 @@ export class PostgreSQLClient extends AntaresCore {
* @memberof PostgreSQLClient
*/
async duplicateTable (params) {
const sql = `CREATE TABLE ${this._schema}.${params.table}_copy (LIKE ${this._schema}.${params.table} INCLUDING ALL)`;
const sql = `CREATE TABLE ${params.schema}.${params.table}_copy (LIKE ${params.schema}.${params.table} INCLUDING ALL)`;
return await this.raw(sql);
}
@ -1168,7 +1168,7 @@ export class PostgreSQLClient extends AntaresCore {
* @memberof PostgreSQLClient
*/
async truncateTable (params) {
const sql = `TRUNCATE TABLE ${this._schema}.${params.table}`;
const sql = `TRUNCATE TABLE ${params.schema}.${params.table}`;
return await this.raw(sql);
}
@ -1179,7 +1179,7 @@ export class PostgreSQLClient extends AntaresCore {
* @memberof PostgreSQLClient
*/
async dropTable (params) {
const sql = `DROP TABLE ${this._schema}.${params.table}`;
const sql = `DROP TABLE ${params.schema}.${params.table}`;
return await this.raw(sql);
}