Skip to content

Commit b952e8c

Browse files
committed
Some housekeeping for examples, tests and documentation
1 parent 7cb3cae commit b952e8c

File tree

8 files changed

+107
-36
lines changed

8 files changed

+107
-36
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# node-oracledb version 6.7.0-dev
22

3-
+**This release is under development and information may be incomplete**
3+
**This release is under development and information may be incomplete**
44

55
The node-oracledb add-on for Node.js powers high performance Oracle Database
66
applications. Applications can be written in TypeScript, or directly in
77
JavaScript.
88

9-
Use node-oracledb 6.6.0 to connect Node.js 14.6, or later, to Oracle
9+
Use node-oracledb 6.7.0-dev to connect Node.js 14.6, or later, to Oracle
1010
Database. Older versions of node-oracledb may work with older versions of
1111
Node.js.
1212

doc/src/user_guide/connection_handling.rst

Lines changed: 14 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4088,15 +4088,13 @@ required authorization permissions to access the Azure App Configuration
40884088
provider.
40894089
40904090
To use node-oracledb to retrieve the configuration information from Azure App
4091-
Configuration, you must install the following libraries:
4092-
4093-
- `App Configuration <https://www.npmjs.com/package/@azure/
4094-
app-configuration>`__ (azure/app-configuration)
4095-
- `Azure AD token authentication <https://www.npmjs.com/package/@azure/
4096-
identity>`__ (azure/identity)
4097-
- `Azure Key Vault <https://www.npmjs.com/package/@azure/keyvault-secrets>`__
4098-
(azure/keyvault-secrets) is optional and required only if a password is
4099-
stored in the vault
4091+
Configuration, you must install certain Microsoft Azure libraries which
4092+
include `Azure App Configuration <https://www.npmjs.com/package/@azure/app-
4093+
configuration>`__ and `Azure Identity <https://www.npmjs.com/package/@azure/
4094+
identity>`__. Optionally, you must install `Azure Key Vault <https://www.
4095+
npmjs.com/package/@azure/keyvault-secrets>`__ which is required only if a
4096+
password is stored in the vault. For installation instructions of these
4097+
libraries, see :ref:`azuremodules`.
41004098
41014099
Configuration information is stored as key-value pairs in Azure App
41024100
Configuration. You must add the connect descriptor as a key under a prefix
@@ -4384,17 +4382,13 @@ of your application's configuration information. Ensure that you have the
43844382
necessary authorization permissions to access OCI Object Storage.
43854383
43864384
To use node-oracledb to retrieve the configuration information from OCI Object
4387-
Storage, you must install the following:
4388-
4389-
- `OCI Node.js Client for Common Utilities <https://www.npmjs.com/package/
4390-
oci-common>`__ (oci-common)
4391-
- `OCI Node.js Client for ObjectStorage Service <https://www.npmjs.com/package/
4392-
oci-objectstorage>`__ (oci-objectstorage)
4393-
- `OCI Node.js Client for Secrets Service <https://www.npmjs.com/package/oci-
4394-
secrets>`__ (oci-secrets) is optional and required only if a password is
4395-
stored in the vault. See `Managing Vault Secrets <https://docs.oracle.com/en
4396-
-us/iaas/Content/KeyManagement/Tasks/managingsecrets.htm>`__ for more
4397-
information.
4385+
Storage, you must install certain OCI libraries which include `OCI Node.js
4386+
Client for Common Utilities <https://www.npmjs.com/package/oci-common>`__ and
4387+
`OCI Node.js Client for ObjectStorage Service <https://www.npmjs.com/package/
4388+
oci-objectstorage>`__. Optionally, you must install `OCI Node.js Client for
4389+
Secrets Service <https://www.npmjs.com/package/oci-secrets>`__ which is
4390+
required only if a password is stored in the vault. For installation
4391+
instructions of these libraries, see :ref:`ocimodules`.
43984392
43994393
Configuration information is stored as a JSON file in OCI Object Storage. You
44004394
must add the connect descriptor in the JSON file. Optionally, you can add the

doc/src/user_guide/installation.rst

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1644,3 +1644,74 @@ The output is like::
16441644

16451645
{ metaData: [ { name: 'D' } ],
16461646
rows: [ { D: '24-Nov-2019 23:39' } ] }
1647+
1648+
.. _configproviderlibraries:
1649+
1650+
Installing Configuration Provider Modules for node-oracledb
1651+
===========================================================
1652+
1653+
To use node-oracledb with
1654+
:ref:`centralized configuration providers <configurationprovider>`, you must
1655+
install the necessary modules for your preferred configuration provider as
1656+
detailed below.
1657+
1658+
.. _azuremodules:
1659+
1660+
Install Modules for Azure App Configuration Provider
1661+
----------------------------------------------------
1662+
1663+
For node-oracledb to work with Azure App Configuration Provider, you must
1664+
install the following Microsoft Azure modules:
1665+
1666+
1. Install the `Azure App Configuration <https://www.npmjs.com/package/@azure/
1667+
app-configuration>`__ module using::
1668+
1669+
npm install @azure/app-configuration
1670+
1671+
2. Install the `Azure Identity <https://www.npmjs.com/package/
1672+
@azure/identity>`__ module using::
1673+
1674+
npm install @azure/identity
1675+
1676+
This library offers a variety of credential classes capable of acquiring
1677+
Microsoft Entra ID (formerly Azure Active Directory) token to authenticate
1678+
service requests.
1679+
1680+
3. Optionally, you need to install the `Azure Key Vault <https://www.npmjs.
1681+
com/package/@azure/keyvault-secrets>`__ module if a password is stored in
1682+
the Azure Key vault. This can be done using::
1683+
1684+
npm install @azure/keyvault-secrets
1685+
1686+
See :ref:`azureappconfig` for information on using this configuration provider
1687+
with node-oracledb.
1688+
1689+
.. _ocimodules:
1690+
1691+
Install Modules for OCI Object Storage Configuration Provider
1692+
-------------------------------------------------------------
1693+
1694+
For node-oracledb to work with OCI Object Storage configuration provider, you
1695+
must install the following OCI modules:
1696+
1697+
1. Install the `OCI Node.js Client for Common Utilities <https://www.npmjs.
1698+
com/package/oci-common>`__ module using::
1699+
1700+
npm install oci-common
1701+
1702+
2. Install the `OCI Node.js Client for ObjectStorage Service <https://www.
1703+
npmjs.com/package/oci-objectstorage>`__ module using::
1704+
1705+
npm install oci-objectstorage
1706+
1707+
3. Optionally, you need to install the `OCI Node.js Client for Secrets Service
1708+
<https://www.npmjs.com/package/oci-secrets>`__ module if a password is
1709+
stored in the OCI vault. This can be done by using::
1710+
1711+
npm install oci-secrets
1712+
1713+
See `Managing Vault Secrets <https://docs.oracle.com/en-us/iaas/Content/
1714+
KeyManagement/Tasks/managingsecrets.htm>`__ for more information.
1715+
1716+
See :ref:`ociobjstorage` for information on using this configuration provider
1717+
with node-oracledb.

examples/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ File Name | Description
6565
[`aqraw.js`](aqraw.js) | Basic Oracle Advanced Queuing (AQ) example passing text messages
6666
[`aqutil.js`](aqutil.js) | Common file to setup the user credentials for all the Advanced Queuing (AQ) examples.
6767
[`blobhttp.js`](blobhttp.js) | Simple web app that streams an image
68+
[`azureConfigProvider.js`](azureConfigProvider.js) | Show how to connect to an Oracle Database using Azure Configuration Providers
6869
[`calltimeout.js`](calltimeout.js) | Shows how to cancel a SQL statement if it doesn't complete in a specified time
6970
[`connect.js`](connect.js) | Basic example for creating a standalone (non-pooled) connection
7071
[`connectionpool.js`](connectionpool.js) | Basic example creating a pool of connections
@@ -101,6 +102,7 @@ File Name | Description
101102
[`lobstream2.js`](lobstream2.js) | Shows using Stream data events to fetch a CLOB
102103
[`lowercasecolumns.js`](lowercasecolumns.js) | Shows how a type handler can convert column names to lower case
103104
[`metadata.js`](metadata.js) | Shows the metadata available after executing SELECT statements
105+
[`ociConfigProvider.js`](ociConfigProvider.js) | Show how to connect to an Oracle Database using OCI Configuration Providers
104106
[`plsqlarray.js`](plsqlarray.js) | Examples of binding PL/SQL "INDEX BY" tables
105107
[`plsqlfunc.js`](plsqlfunc.js) | How to call a PL/SQL function
106108
[`plsqlproc.js`](plsqlproc.js) | How to call a PL/SQL procedure

examples/azureProviderSample.js renamed to examples/azureConfigProvider.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@
2323
* limitations under the License.
2424
*
2525
* NAME
26-
* azureProviderSample.js
26+
* azureConfigProvider.js
2727
*
2828
* DESCRIPTION
29-
* Sample program to connect to the database using DB connectstring, username and password
30-
* which are fetched from the Azure Configuration Store using the connectstring which consists of
31-
* required parameters to authenticate azure configuration store.
29+
* Sample program to connect to the database using DB connect string,
30+
* username and password fetched from the Azure Configuration Providers
31+
* using the Azure Configuration Store URL.
3232
*
3333
*****************************************************************************/
3434

@@ -62,7 +62,9 @@ if (process.env.NODE_ORACLEDB_DRIVER_MODE === 'thick') {
6262
console.log(oracledb.thin ? 'Running in thin mode' : 'Running in thick mode');
6363

6464
async function run() {
65-
// replace xxxx with the corresponding values of the parameter
65+
// Replace the connect string with correct Azure Config Store URL
66+
// Replace xxxx with the corresponding values of the authentication
67+
// parameters
6668
let connection;
6769
const options = {
6870
connectString: 'config-azure://testappconfig.azconfig.io/?key=testapp/testkey/&azure_client_id=xxxx&azure_client_certificate_path=xxxx&azure_tenant_id=xxxx'

examples/ociProviderSample.js renamed to examples/ociConfigProvider.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@
2323
* limitations under the License.
2424
*
2525
* NAME
26-
* ociProviderSample.js
26+
* ociConfigProvider.js
2727
*
2828
* DESCRIPTION
29-
* Sample program to connect to the database using DB connectstring, username and password
30-
* which are fetched from the OCI Object Store using the connectstring which consists of
31-
* required parameters to authenticate OCI Object Store.
29+
* Sample program to connect to the database using DB connect string,
30+
* username and password fetched from the OCI Configuration Providers
31+
* using the OCI Object Store Connect String URL.
3232
*
3333
*****************************************************************************/
3434

@@ -62,10 +62,11 @@ if (process.env.NODE_ORACLEDB_DRIVER_MODE === 'thick') {
6262
console.log(oracledb.thin ? 'Running in thin mode' : 'Running in thick mode');
6363

6464
async function run() {
65-
//replace xxxx with correct values of the parameter
65+
// Replace the connect string with correct OCI Config Store URL
66+
// Replace xxxx in the connect string with the correct authentication parameter values
6667
let connection;
6768
const options = {
68-
connectString: 'config-ociobject://test.us-phoenix-1.oraclecloud.com/n/testnamespace/b/testbucket/o/testobject?oci_tenancy=xxxx&oci_user=xxxx&oci_fingerprint=xxxx&oci_key_file=xxxx',
69+
connectString: 'config-ociobject://test.region.oraclecloud.com/n/testnamespace/b/testbucket/o/testobject?oci_tenancy=xxxx&oci_user=xxxx&oci_fingerprint=xxxx&oci_key_file=xxxx',
6970
};
7071
try {
7172
// Get a non-pooled connection

examples/selectjson.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (c) 2015, 2023, Oracle and/or its affiliates. */
1+
/* Copyright (c) 2015, 2024, Oracle and/or its affiliates. */
22

33
/******************************************************************************
44
*
@@ -87,7 +87,7 @@ async function run() {
8787
console.error(e);
8888
}
8989

90-
connection.execute(`CREATE TABLE no_purchaseorder (po_document JSON)`);
90+
await connection.execute(`CREATE TABLE no_purchaseorder (po_document JSON)`);
9191

9292
console.log('2. Inserting Data');
9393

test/binding_DMLInsert.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,8 @@ describe('92.binding_DMLInsert.js', function() {
103103
await connection.execute("insert into " + table_name + " ( content ) values (:c)", bindVar);
104104
},
105105
// ORA-01877: string is too long for internal buffer
106-
/ORA-01877:/
106+
// ORA-01866: the datetime class is invalid
107+
/ORA-01877:|ORA-01866:/
107108
);
108109
}
109110
if (dbColType === "BLOB" || dbColType.indexOf("RAW") > -1) {

0 commit comments

Comments
 (0)