-
Notifications
You must be signed in to change notification settings - Fork 126
Mapepire as SQL runner #2940
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
base: master
Are you sure you want to change the base?
Mapepire as SQL runner #2940
Conversation
Signed-off-by: worksofliam <[email protected]>
Signed-off-by: worksofliam <[email protected]>
Signed-off-by: worksofliam <[email protected]>
Signed-off-by: worksofliam <[email protected]>
Signed-off-by: worksofliam <[email protected]>
Signed-off-by: worksofliam <[email protected]>
Signed-off-by: worksofliam <[email protected]>
Signed-off-by: worksofliam <[email protected]>
Signed-off-by: worksofliam <[email protected]>
Signed-off-by: worksofliam <[email protected]>
|
👋 A new build is available for this PR based on f07c9bc. |
Signed-off-by: worksofliam <[email protected]>
Signed-off-by: worksofliam <[email protected]>
Signed-off-by: worksofliam <[email protected]>
Signed-off-by: worksofliam <[email protected]>
Signed-off-by: worksofliam <[email protected]>
Signed-off-by: worksofliam <[email protected]>
Signed-off-by: worksofliam <[email protected]>
Signed-off-by: worksofliam <[email protected]>
Signed-off-by: worksofliam <[email protected]>
Signed-off-by: worksofliam <[email protected]>
Signed-off-by: worksofliam <[email protected]>
Signed-off-by: worksofliam <[email protected]>
Signed-off-by: worksofliam <[email protected]>
Signed-off-by: worksofliam <[email protected]>
Signed-off-by: worksofliam <[email protected]>
Signed-off-by: worksofliam <[email protected]>
Signed-off-by: worksofliam <[email protected]>
Signed-off-by: worksofliam <[email protected]>
Signed-off-by: worksofliam <[email protected]>
Signed-off-by: worksofliam <[email protected]>
Signed-off-by: worksofliam <[email protected]>
Signed-off-by: worksofliam <[email protected]>
This reverts commit 53f1b80.
|
All test cases now pass |
chrjorgensen
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@worksofliam Before this PR we could get more than one spoolfile from one command in an action. One example is found in issue #3004.
Will this PR support that?
We don't know how many spoolfiles are created by one command run, and we may need them all. User created build commands may run more than one CRT-command and thus create more than one spoolfile.
| } | ||
| } | ||
|
|
||
| const LAST_SPOOL_STATEMENT = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@worksofliam This SQL statement will get the latest spoolfile created by the user - but not necessarily created in this job! If the user has other jobs running, also creating spoolfiles, this SQL may pick one of those instead of the intended one...
|
@chrjorgensen it is likely we'll need to track previously obtains spools like we do job log messages. It's not something we do in this at the moment, but we can likely do it. It currently just fetches the latest spoil after the command has executed. |
worksofliam
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this a big issue?
| await this.ibmi.runSQL([ | ||
| `@QSYS/CPYF FROMFILE(${library}/${sourceFile}) FROMMBR(${member}) TOFILE(QTEMP/QTEMPSRC) TOMBR(TEMPMEMBER) MBROPT(*REPLACE) CRTFILE(*YES);`, | ||
| `@QSYS/CPYFRMSTMF FROMSTMF('${tempRmt}') TOMBR('${Tools.qualifyPath("QTEMP", "QTEMPSRC", "TEMPMEMBER", undefined)}') MBROPT(*REPLACE) STMFCCSID(1208) DBFCCSID(${this.config.sourceFileCCSID})`, | ||
| `@QSYS/CPYFRMSTMF FROMSTMF('${tempRmt}') TOMBR('${Tools.qualifyPath("QTEMP", "QTEMPSRC", "TEMPMEMBER", undefined)}') MBROPT(*REPLACE)`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why was streamfile CCSID removed?
| } | ||
| else { | ||
| copyResult = await this.ibmi.runCommand({ | ||
| command: `QSYS/CPYFRMSTMF FROMSTMF('${tempRmt}') TOMBR('${path}') MBROPT(*REPLACE) STMFCCSID(1208) DBFCCSID(${this.config.sourceFileCCSID})`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here, why was streamfile CCSID removed?
Changes
Rips out the legacy SQL runner with Mapepire, which is bundled in the VSIX and installed as a component.
ILE command improvements
runCommandhas a lot of new logic. We now we should do all compiles with SQL. This means no moresystem, no more standard in or standard out fromsystem. Due to that, we no longer have access to the job log or spool file generated by the executed command.runCommandhas four steps now:qcmdexc- if required)qcmdexc)qsys2.joblog_info('*'))ORDINAL_POSITIONand I believe there are some instances where it is not updated correctly from prior commands. The only way to get around that is to always fetch the job log even if it's not needed (skipDetail)Due to this implementation,
runCommandcannot really run asynchronously likesystemallowed. At therunCommandlevel, I have had to implement a queue system so that these sequence of events can only happen one at a time. This ensures the right job log and spool file is returned for the correct command.To do
npm run dscas part of VSIX buildliblistusageHow to test this PR
Checklist
console.logs I added