Skip to content

Commit

Permalink
fix: Fix CLI query command TypeError (#7043)
Browse files Browse the repository at this point in the history
Switch to using named args property now that it is explicitly defined in the command.
  • Loading branch information
peterjroberts committed Nov 9, 2020
1 parent 6ef8ffe commit b35397e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/commands/QueryCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,9 @@ export class QueryCommand implements yargs.CommandModule {

// create a query runner and execute query using it
queryRunner = connection.createQueryRunner();
console.log(chalk.green("Running query: ") + PlatformTools.highlightSql(args._[1]));
const queryResult = await queryRunner.query(args._[1]);
const query = args.query as string;
console.log(chalk.green("Running query: ") + PlatformTools.highlightSql(query));
const queryResult = await queryRunner.query(query);

if (typeof queryResult === "undefined") {
console.log(chalk.green("Query has been executed. No result was returned."));
Expand Down

1 comment on commit b35397e

@Yehonal
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pleerock can you bump the version with this fix, please?

It breaks some workflows.

PS is there any test running on this command?

Please sign in to comment.