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

Is the SQL feature going to be removed from the toolkit?

Open ehenson opened this issue 5 years ago • 7 comments

As I was studying the master branch it shows that the iSql classes will be removed in the next major release. Is there still going to be support for executing SQL through a rest interface? The reason I am asking is that my applications are running on a Linux server calling into the XMLSERVICE.cgi program.

ehenson avatar May 07 '20 05:05 ehenson

Yes the iSql class is deprecated and will be removed in v2.x. We are releasing v1.0.0 soon so I expect iSql to still be supported for some time.

We recommend users to migrate to the odbc, idb-connector, or idb-pconnector npm packages. These are much better SQL interfaces for IBM i and should be used instead. In your case, use odbc to connect to Db2 from your linux server. Refer to the odbc setup guide for instructions.

abmusse avatar May 07 '20 22:05 abmusse

I do agree with if one wants to query tables outside of the job's QTEMP. What I have been doing is calling a program, it dumps into QTEMP and then I select * from qtemp/table in the same XMLSERVICE call which is fronted by a CL to manage and it also cleans up the QTEMP files. I will have to refactor to return a DS array. This is not a problem to make it is just that it was an easy pattern when working with the senior RPG programmers.

Thank you all for all of the great work with this package!

ehenson avatar May 08 '20 00:05 ehenson

As @abmusse said, we plan to support iSql for some time and the SQL capabilities of XMLSERVICE aren't going away so I suppose one could always generate the XML themselves and pass it to the toolkit (or fork the iSql classes/functions if/when needed).

Additionally, you can use the node-odbc transort in the upcoming v1.0 instead of REST. By using the default *here control option for XMLSERVICE, the program should be called in the SQL job so then you could query with odbc instead of iSql.

kadler avatar May 08 '20 02:05 kadler

@kadler, you bring up a good point. I was too fixed on rest I have forgotten about the odbc option of the connection. Thank you for the hint! I'll do that instead.

ehenson avatar May 08 '20 02:05 ehenson

Will you all consider the ability to set an existing opened odbc connection to the odbc transport? This should should allow me to open a connection, which establishes a job, then I can use the toolkit to make the program call, and finally I can use the same odbc connection to query the QTEMP files.

ehenson avatar May 08 '20 15:05 ehenson

Ahh, right. I forgot that the Node version of this package opens its own connection and closes it every time you call it. I've definitely had that idea, perhaps we can target it for v1.1 or beyond.

kadler avatar May 08 '20 17:05 kadler

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

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

I think we can close this one out as the original question is answered and we are tracking the ability to use an existing connection in the open PR.

abmusse avatar Sep 26 '24 21:09 abmusse