-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
node-compat: npm:oracledb(thin mode) #20924
Comments
I have debugged it and found that
|
Perhaps support for deno/ext/node/ops/crypto/cipher.rs Line 26 in 7561f6e
I bypassed the
|
@bartlomieju @kt3k
Perhaps support for deno/ext/node/ops/crypto/cipher.rs Line 26 in 7561f6e
Also, regarding the fix of Node
Deno
|
@chibat can you please open a separate issue for this problem? |
@bartlomieju |
@chibat As a workaround for missing "aes-256-cbc" it is possible to override functions "createCipheriv" and "createDecipheriv" with ones from https://github.com/browserify/browserify-aes
and configure Deno's importMap to use it specifically for oracledb's scope:
|
Let's reopen as this doesn't look resolved |
There is something that is going on when you hit release 1.39.0 where after connecting to the database when a query is issued it just hangs. All other versions from 1.37.x and 1.38.x all work perfectly fine with the exact same script. The actual Node.js package did just change to a new release (6.3.0) on December 21st but even when using the previous release (6.2.0) from October 11th which again worked until 1.39.0 the same hanging issue occurs. When running the bulk of the same script, the only difference being is the way the package is imported, Node.js has no similar issue with either version of the package up through release 21.5.0. |
I just tried again using 1.39.4 and its still just hangs. As soon as I switch back to 1.38.5 it works. Something substantially had to change when import npm modules such that when executing methods in the module, perhaps through those that are called through await (i.e. getConnection which is where mine hangs) they seemingly go into never never land. |
@r-dahlstedt-linux-guy are you using a TLS connection? |
No |
We moved forward. |
Today I get the same error as @chibat . Thank you so much for making deno, it's great, and adding oracle support would be a great improvement. |
@salva-dev I confirm that the following comment workaround works well. I believe thick mode, which uses a native Oracle client, will also work. |
@chibat , thanks a lot. The workaround works for me!!. |
I have confirmed canary release.
There seems to be a difference in size when decrypted. decrypted.length
|
I have excerpted the test.mjs import { Buffer } from 'node:buffer';
import crypto from 'node:crypto';
const algorithm = 'aes-256-cbc';
const key = Buffer.from([0x84,0xdc,0xdd,0x96,0x49,0x68,0x73,0x4f,0xdf,0x0d,0xe4,0xa2,0xcb,0xa4,0x71,0xc2,0xe0,0xa7,0x53,0x93,0x0b,0x84,0x1c,0x01,0x4b,0x1e,0x77,0xf4,0x56,0xb5,0x79,0x7b]);
const val = Buffer.from([0xfe,0xab,0xbd,0xf6,0x6e,0x2c,0x71,0xcc,0x78,0x0d,0x0c,0xd2,0x76,0x5d,0xcc,0xe2,0x83,0xe8,0xae,0x7e,0x58,0xfc,0xc1,0xa9,0xac,0xaf,0xc6,0x78,0x58,0x1e,0x0e,0x06]);
const iv = Buffer.alloc(16, 0);
const decipher = crypto.createDecipheriv(algorithm, key, iv);
decipher.setAutoPadding(false);
let decrypted = decipher.update(val);
console.log(JSON.stringify(decrypted));
|
This change fixes Decipheriv behavior when autoPadding disabled and enabled. By this change, the example given in #20924 (comment) works in the same way as Node. closes #20924
I was able to connect to the Oracle DB.
|
I just tried to connect to oracle cloud using wallet without luck, just said connecting.
using popos and deno 2.0.6
import oracledb from 'oracledb'
async function connectToOracle() {
let connection;
try {
console.log("connecting")
// Establish connection to the Oracle Database
connection = await oracledb.getConnection({
user: 'ADMIN',
password: 'removed... ',
connectString: 'removed... oraclecloud.com',
walletLocation: "/home/xxxxx/Github/oracletest/wallet",
walletPassword: 'removed... '
});
console.log('Successfully connected to Oracle Database!');
// Example Query: Select all records from a sample table
const result = await connection.execute(
`SELECT 1 form dual` // Adjust as needed
);
console.log('Query Results:', result.rows);
} catch (err) {
console.error('Error connecting to Oracle Database:', err);
} finally {
if (connection) {
try {
await connection.close();
console.log('Connection closed.');
} catch (err) {
console.error('Error closing connection:', err);
}
}
}
}
connectToOracle(); |
@vegarringdal |
What happens if the following environment variable are set before execution?
|
Connection string, just incase its doing something |
Node compat doesn’t work for
npm:oracledb
(thin mode).The steps to reproduce are summarized below.
test repository: https://github.com/chibat/oracledb-test
start oracle database
main.js
Deno
Node
Bun
related issue: oracle/node-oracledb#1258
The text was updated successfully, but these errors were encountered: