Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Speed up components by doing SYSROUTINES lookup #2486

Closed
worksofliam opened this issue Jan 27, 2025 · 1 comment
Closed

Speed up components by doing SYSROUTINES lookup #2486

worksofliam opened this issue Jan 27, 2025 · 1 comment
Labels
enhancement New feature or request

Comments

@worksofliam
Copy link
Contributor

Each component has the functionality to check if the object exists on the system. Those components that use SQL should instead do a mass lookup to check the state. Something like this...

  private getComponentList(): IBMiComponent[] {
    return Array.from(extensionComponentRegistry.getComponents().values()).flatMap(a => a.flat())
  }

  public async preCheck() {
    const names = this.getComponentList().map(c => c.getIdentification().objectName).filter(o => o) as string[];
    const tempLib = this.connection.getConfig().tempLibrary;

    const sql = [
      `select routine_name, cast(LONG_COMMENT as VarChar(200)) LONG_COMMENT`,
      `from qsys2.sysroutines`,
      `where routine_schema = '${tempLib.toUpperCase()}' and routine_name in (${names.map(n => `'${n}'`).join(`, `)})`
    ].join(` `);
  }
@worksofliam worksofliam added the enhancement New feature or request label Jan 27, 2025
@worksofliam
Copy link
Contributor Author

Did some performance work in #2502

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant