Skip to content

Commit

Permalink
fix: prevent undefined in template literal
Browse files Browse the repository at this point in the history
  • Loading branch information
mshanemc committed Jun 27, 2024
1 parent 52d1199 commit ca61218
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/commands/data/query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export class DataSoqlQueryCommand extends SfCommand<unknown> {
* When the user is using global '--json' flag an instance of SfdxResult is returned.
* This is necessary since '--json' flag reports results in the form of SfdxResult
* and bypasses the definition of start result. The goal is to have the output
* from '--json' and '--resulformat json' be the same.
* from '--json' and '--result-format json' be the same.
*
* The DataSoqlQueryResult is necessary to communicate user selections to the reporters.
* The 'this' object available during display() function does not include user input to
Expand All @@ -105,7 +105,7 @@ export class DataSoqlQueryCommand extends SfCommand<unknown> {
const flags = (await this.parse(DataSoqlQueryCommand)).flags;

try {
// soqlqueryfile will be present if flags.query isn't. Oclif exactlyOne isn't quite that clever
// --file will be present if flags.query isn't. Oclif exactlyOne isn't quite that clever
const queryString = flags.query ?? fs.readFileSync(flags.file as string, 'utf8');
const conn = flags['target-org'].getConnection(flags['api-version']);
if (flags['result-format'] !== 'json') this.spinner.start(messages.getMessage('queryRunningMessage'));
Expand Down Expand Up @@ -178,14 +178,14 @@ export class DataSoqlQueryCommand extends SfCommand<unknown> {
connection: Connection | Connection['tooling'],
query: string,
logger: Logger,
maxFetch: number | undefined,
allRows: boolean | undefined = false
maxFetch = 50_000,
allRows = false
): Promise<SoqlQueryResult> {
logger.debug('running query');

const result = await connection.query(query, {
autoFetch: true,
maxFetch: maxFetch ?? 50_000,
maxFetch,
scanAll: allRows,
});
if (result.records.length && result.totalSize > result.records.length) {
Expand Down

0 comments on commit ca61218

Please sign in to comment.