nodejs-itoolkit icon indicating copy to clipboard operation
nodejs-itoolkit copied to clipboard

feat: The ability to use an existing odbc connection

Open ehenson opened this issue 5 years ago • 3 comments

By setting the odbcConnection parameter of the transportOptions it will use the existing connection instead of creating and managing its own connection. This is useful to be able to run SQL queries in the same job. An example would be if a program created files in the QTEMP library and you need to retrieve the records.

ehenson avatar May 08 '20 22:05 ehenson

In the initialization I am creating the pool:

this.odbcPool = await odbc.pool('DSN=<dsn name>');

I obtain a connection:

this._odbcConnection = await this.odbcPool.connect();

finally, I pass it to the itoolkit Connection:

    const connection = new Connection({
      transport: 'odbc',
      transportOptions: {
        odbcConnection: this._odbcConnection,
      },
    });

ehenson avatar May 11 '20 17:05 ehenson

My apologies for the lack of signOffs. I have realized that I have forgotten about the contributors document and I have now configured my tools for signOff and gpg.

ehenson avatar May 11 '20 18:05 ehenson

:wave: Hi! This pull request has been marked stale due to inactivity. If no further activity occurs, it will automatically be closed.

github-actions[bot] avatar Jun 11 '20 00:06 github-actions[bot]