From ba90fd904e7af06c982031c111e0698b65ea4821 Mon Sep 17 00:00:00 2001 From: Umed Khudoiberdiev Date: Mon, 26 Feb 2018 10:12:55 +0500 Subject: [PATCH] removed bad awaits --- src/commands/QueryCommand.ts | 2 +- src/connection/Connection.ts | 2 +- src/schema-builder/RdbmsSchemaBuilder.ts | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/commands/QueryCommand.ts b/src/commands/QueryCommand.ts index adc18b6f9b..0ae6f532da 100644 --- a/src/commands/QueryCommand.ts +++ b/src/commands/QueryCommand.ts @@ -44,7 +44,7 @@ export class QueryCommand { connection = await createConnection(connectionOptions); // create a query runner and execute query using it - queryRunner = await connection.createQueryRunner("master"); + queryRunner = connection.createQueryRunner("master"); console.log(chalk.green("Running query: ") + PlatformTools.highlightSql(argv._[1])); const queryResult = await queryRunner.query(argv._[1]); console.log(chalk.green("Query has been executed. Result: ")); diff --git a/src/connection/Connection.ts b/src/connection/Connection.ts index ec3e7cb818..f39399fd49 100644 --- a/src/connection/Connection.ts +++ b/src/connection/Connection.ts @@ -250,7 +250,7 @@ export class Connection { * Can be used only after connection to the database is established. */ async dropDatabase(): Promise { - const queryRunner = await this.createQueryRunner("master"); + const queryRunner = this.createQueryRunner("master"); const schemas = this.entityMetadatas .filter(metadata => metadata.schema) .map(metadata => metadata.schema!); diff --git a/src/schema-builder/RdbmsSchemaBuilder.ts b/src/schema-builder/RdbmsSchemaBuilder.ts index e5d463c6e3..2f00a4f896 100644 --- a/src/schema-builder/RdbmsSchemaBuilder.ts +++ b/src/schema-builder/RdbmsSchemaBuilder.ts @@ -56,7 +56,7 @@ export class RdbmsSchemaBuilder implements SchemaBuilder { * Creates complete schemas for the given entity metadatas. */ async build(): Promise { - this.queryRunner = await this.connection.createQueryRunner("master"); + this.queryRunner = this.connection.createQueryRunner("master"); await this.createNewDatabases(); await this.queryRunner.startTransaction(); try { @@ -85,7 +85,7 @@ export class RdbmsSchemaBuilder implements SchemaBuilder { * Returns sql queries to be executed by schema builder. */ async log(): Promise<(string|{ up: string, down: string })[]> { - this.queryRunner = await this.connection.createQueryRunner("master"); + this.queryRunner = this.connection.createQueryRunner("master"); try { await this.createNewDatabases(); this.tables = await this.loadTableSchemas();