-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Can not insert Date with oracledb 4 using Jest #1152
Comments
Your code mixes arguments that belong with As it currently is (only changing
And the data is stored fine:
|
Hello cjbj, Now I have the executeMany Example which does not work.
It create the following error:
When I execute the example with the 3.1.2 Version it is working. btw. |
@dmcghan the given @darlenya The new code also works fine for me.
The 3 dates are inserted:
The actual code I ran is:
|
@cjbj Should we update the doc then? :) |
@dmcghan the quoted doc is correct but may be a bit labored (I might change the 2nd "each" to "one"). The SQL has one bind variable and the bindDefs describes one bind variable. |
Hi, thanks for your help! Your are right, the code is working. It seems to be a problem with the testing framework jest. |
@cjbj Ah yes, I was looking at the bind data, not the |
@darlenya can you identify what has changed? |
@cjbj I have the same code. Only change the dependency of the oracledb version. When switching back to 3.1.2 it is woking again. When using 4.0.1 it fails. The versions of all the other dependencies is unchanged. |
A small demo Project which shows the problem.
or |
I just tried your example....and the dates were inserted without any problems! |
@anthony-tuininga yes, currently the dependency is oracledb 3.1.2 if you change this to 4.0.1 it is not working. |
Yes, I did it with oracledb 4 -- no problems. :-) |
Hi Anthony, first thanks for the time you invest. I have tried it again with node 10.16.0 and with node 12.10.0. I always got the same Error. I am using a Mac with macOS mojave. With yarn 1.15.2 and 1.17.3. Always got the same error. But the error is only with 'yarn test'. The code itself (outside yarn test) is working |
Ah. I am not using yarn. In that case, it probably isn't an issue with node-oracledb itself. If you figure out what the issue is, though, let us know! |
Yes, when I find the issue I will report it. I the pas when I had problems with yarn it was enought to set the "testEnvironment": "node", in the jest.config.json. But this time not. |
@darlenya Try using |
Hi @dmcghan, did what you mentioned. Here is the result of the different tries: add: oracle 4.0.1node version: 10.16.0
|
Just pointing out a couple of things here:
It looks like you've logged the |
@dmcghan Hi Dan, yes in the first post it was a different error, but in the second post it was this error. I have now change the code in the following way:
Here is the Result with npm Test:`ip-192-168-188-76:oracletest torstenlink$ npm test
PASS ./demoTest.js console.log demo.js:30 console.log demo.js:31 console.log demo.js:32 console.log demo.js:33 console.log demo.js:43 Here the Result with node direct:
|
Please change these lines: console.log(`Sql: ${sql}`)
console.log(`bindParamter: ${bindParameter}`)
console.log(`options: ${options}`) to this: console.log('Sql:', sql)
console.log('bindParamter:', bindParameter)
console.log('options:', options) Then test again. |
Ok changed the logs as you suggested.
And
|
Thanks. Looks like they are exactly the same... How is your I need more info to reproduce... |
Sorry, I just found your download link... Look into it. |
I have diagnosed the issue and determined the reason for the difference -- namely, that the global And if all of that was too technical, I know the problem and have a solution which will be available to you reasonably soon, I hope! |
@ALL of you, thank you for the time invest in this problem. Should I close it or will you do it? Torsten Link |
We'll close it when it is fixed. Thanks for reporting it and your patience. |
@darlenya node-oracledb 4.1 is out with a workaround / fix for using Dates in Jest. |
With the update to oracledb 4.1 I can not insert Dates anymore.
The following code works with oracledb 3.1.2
Since version 4.1 I get the following Error
The text was updated successfully, but these errors were encountered: