Registry / database / oracle-nosqldb

oracle-nosqldb

JSON →
library5.5.3jsnpmunverified

The `oracle-nosqldb` package provides the Node.js SDK for interacting with Oracle NoSQL Database, supporting both the Oracle NoSQL Database Cloud Service and on-premise deployments. Currently at version 5.5.3, the library offers comprehensive interfaces for developing JavaScript and TypeScript applications, enabling operations like table creation, data insertion, retrieval, and schema management. While a strict release cadence isn't specified, it appears to follow major Node.js ecosystem updates and NoSQL database feature releases. A key differentiator is its dual support for cloud and and on-premise environments, offering a consistent API across deployment models. Developers need Node.js 12 or higher, and for TypeScript projects, TypeScript 5.0.x or higher is recommended.

npm install oracle-nosqldb
INSTALL
IMPORT
SIG · ORACLE-NOSQLDB
O
oracle-nosqldb
databasejavascriptv5.5.3
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

NoSQLClient
import { NoSQLClient } from 'oracle-nosqldb';
const NoSQLClient = require('oracle-nosqldb');
The NoSQLClient class is a named export, common in both ESM and CJS environments (using destructuring for CJS).
Region
import { Region } from 'oracle-nosqldb';
import Region from 'oracle-nosqldb';
Region is a named export, not a default export. Incorrectly importing it as a default will fail.
ServiceType
import { ServiceType } from 'oracle-nosqldb';
const ServiceType = require('oracle-nosqldb');
ServiceType is a named export. For CommonJS, ensure proper destructuring like `require('oracle-nosqldb').ServiceType`.

This quickstart demonstrates creating a table, inserting a record using `put()`, retrieving it with `get()`, and finally dropping the table. It provides configuration placeholders for both Oracle NoSQL Database Cloud Service and on-premise/simulator environments.

/* * A simple example that * - creates a table * - inserts a row using the put() operation * - reads a row using the get() operation * - drops the table * * To run: * 1. Edit for your target environment and credentials * 2. Run it: * node quickstart.js cloud|cloudsim|kvstore * * Use 'cloud' for the Oracle NoSQL Database Cloud Service * Use 'cloudsim' for the Oracle NoSQL Cloud Simulator * Use 'kvstore' for the Oracle NoSQL Database on-premise */ 'use strict'; const NoSQLClient = require('oracle-nosqldb').NoSQLClient; const Region = require('oracle-nosqldb').Region; const ServiceType = require('oracle-nosqldb').ServiceType; // --- Configuration (replace with your actual credentials and endpoint) --- // For Oracle NoSQL Database Cloud Service: // const config = { // serviceType: ServiceType.CLOUD, // region: Region.US_PHOENIX_1, // e.g., Region.US_PHOENIX_1 // auth: { // userName: process.env.OCI_USER_OCID ?? '', // tenantId: process.env.OCI_TENANT_OCID ?? '', // privateKey: process.env.OCI_PRIVATE_KEY_PATH ?? '', // fingerprint: process.env.OCI_FINGERPRINT ?? '', // passPhrase: process.env.OCI_PRIVATE_KEY_PASSPHRASE ?? '' // Optional // } // }; // For Oracle NoSQL Cloud Simulator or On-Premise: const config = { serviceType: ServiceType.KVSTORE, endpoint: process.env.NOSQL_ENDPOINT ?? 'localhost:8080' // Default for simulator/on-prem }; async function runQuickstart() { let client; try { client = new NoSQLClient(config); const tableName = 'quickstartTable'; console.log(`Creating table: ${tableName}`); await client.tableDDL(`CREATE TABLE ${tableName} (id LONG, name STRING, PRIMARY KEY (id))`); console.log('Table created.'); const row = { id: 1, name: 'Hello, Oracle NoSQL!' }; console.log(`Putting row: ${JSON.stringify(row)}`); await client.put(tableName, row); console.log('Row put.'); console.log(`Getting row with id: ${row.id}`); const result = await client.get(tableName, { id: row.id }); console.log(`Got row: ${JSON.stringify(result.value)}`); console.log(`Dropping table: ${tableName}`); await client.tableDDL(`DROP TABLE ${tableName}`); console.log('Table dropped.'); } catch (error) { console.error('Error:', error.message); } finally { if (client) { client.close(); } } } runQuickstart();
Debug
Known issues
gotchaThe SDK requires Node.js version 12.0.0 or higher. Using older versions will result in runtime errors.
fix
Upgrade Node.js to version 12.0.0 or higher. LTS versions are generally recommended.
affects: <12.0.0
gotchaWhen using TypeScript, version 5.0.x or higher is required for optimal type inference and compatibility with the shipped type declarations.
fix
Ensure TypeScript version 5.0.x or higher is installed in your project: `npm install typescript@^5.0.0`.
affects: <5.0.x
gotchaConnecting to Oracle NoSQL Database Cloud Service necessitates proper Oracle Cloud Infrastructure (OCI) authentication configuration, including a user, group policy, and API signing keys. Incorrect credentials or policies will lead to authentication failures.
fix
Refer to OCI documentation for setting up API signing keys and IAM policies, and ensure `NoSQLClient` is initialized with the correct `auth` configuration.
affects: >=1.0.0
gotchaFor on-premise Oracle NoSQL Database deployments, a running Oracle NoSQL Database instance and a separate NoSQL Proxy server are required for the Node.js SDK to connect. The SDK communicates via the HTTP proxy, not directly with the database nodes.
fix
Ensure both the Oracle NoSQL Database and the NoSQL Proxy are running and accessible from your application's host. Configure the `endpoint` in `NoSQLClient` accordingly.
affects: >=1.0.0
gotchaThe quickstart examples and initial setup often assume a non-secure configuration for simplicity. Secure configurations for both cloud and on-premise environments are more complex and require additional setup for certificates, secure proxies, and authentication.
fix
Always review security best practices and configure secure connections (e.g., HTTPS for proxy, proper IAM for cloud) for production environments.
affects: >=1.0.0
Errors
Common errors & fixes
Error: Cannot find module 'oracle-nosqldb'
The `oracle-nosqldb` package has not been installed or is not accessible in the current project's `node_modules`.
fix
Run `npm install oracle-nosqldb` in your project directory.
Error: Missing authentication credentials.
When connecting to Oracle NoSQL Database Cloud Service, the `auth` configuration in `NoSQLClient` is incomplete or incorrect, or OCI environment variables are not set.
fix
Provide all required OCI credentials (user OCID, tenant OCID, private key, fingerprint) in the `auth` object or ensure they are correctly sourced as environment variables. Check OCI IAM policies for necessary permissions.
Error: connect ECONNREFUSED <address>:<port>
The application failed to connect to the NoSQL Database proxy server, often due to the server not running, being on a different host/port, or firewall issues.
fix
Verify that the Oracle NoSQL Database proxy server is running, listening on the specified host and port (e.g., `localhost:8080`), and network firewalls are not blocking the connection.
TypeError: Class constructor NoSQLClient cannot be invoked without 'new'
The `NoSQLClient` class is being called as a function (e.g., `NoSQLClient(config)`) instead of instantiated with the `new` keyword.
fix
Always create an instance of `NoSQLClient` using `const client = new NoSQLClient(config);`.
Upgrade
Version history
5.5.3latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
10 hits · last 30 days
node
10
Resources
oracle-nosqldb — npm install oracle-nosqldb · libregistry