Skip to content

Updates demo dependencies. Minor code tweaks #143

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

Merged
merged 1 commit into from
Feb 4, 2021
Merged

Updates demo dependencies. Minor code tweaks #143

merged 1 commit into from
Feb 4, 2021

Conversation

cjbj
Copy link
Contributor

@cjbj cjbj commented Feb 4, 2021

Signed-off-by: Christopher Jones christopher.jones@oracle.com

Signed-off-by: Christopher Jones <christopher.jones@oracle.com>
@cjbj cjbj requested a review from anthony-tuininga February 4, 2021 02:05
Copy link
Contributor

@dmcghan dmcghan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent changes. Thanks, Chris!

Comment on lines +4 to +9
// Tell node-oracledb where to find the Oracle Instant Client 'Basic' package on macOS and Windows
if (process.platform === 'darwin') {
oracledb.initOracleClient({libDir: process.env.HOME + '/Downloads/instantclient_19_8'});
} else if (process.platform === 'win32') {
oracledb.initOracleClient({libDir: 'C:\\oracle\\instantclient_19_8'}); // note the double backslashes
} // else you must set the system library search path before starting Node.js
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good stuff!

Comment on lines +29 to +44
try {
conn = await oracledb.getConnection();
result = await conn.execute(statement, binds, opts);
return (result);
} catch (err) {
console.error(err);
throw (err);
} finally {
if (conn) { // conn assignment worked, need to close
try {
await conn.close();
} catch (err) {
console.error(err);
}
}
});
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this better than using an explicit promise.

"oracledb": "^3.1.2"
"express": "^4.17.1",
"morgan": "^1.10.0",
"oracledb": "^5.1.0"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! :)

@cjbj cjbj merged commit 1de368c into oracle-samples:master Feb 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants