The `strong-oracle` package is a Node.js driver for connecting to Oracle databases, leveraging Oracle's own Instant Client libraries. It allows Node.js applications to interact with Oracle databases by providing a thin wrapper around the Oracle Call Interface (OCI). As of version 1.9.0, it remains a CommonJS module. Its release cadence appears to be slow, with `1.x` being the primary stable branch, suggesting it is in maintenance mode rather than active feature development. A key differentiator is its reliance on a locally installed Oracle Instant Client, which requires careful manual setup of environment variables, symbolic links, and system libraries (like `libaio` on Linux) specific to the operating system and architecture. This direct OCI binding offers performance and features consistent with Oracle's native client, but introduces a significant pre-installation and configuration overhead compared to pure JavaScript drivers. The library supports various connection methods, including direct hostname/port, full TNS connection strings, and TNS aliases configured in `tnsnames.ora`.
npm install strong-oracleVerified import paths — ran on the pinned version, not inferred.
Demonstrates connecting to an Oracle database using basic connection parameters, executing a simple query, and properly closing the connection.
Ensure that the Oracle Instant Client (Basic/Basic Lite and SDK) packages downloaded match your system's architecture (e.g., x64 for 64-bit Node.js and OS). Reinstall if necessary.
Refer to the package README for detailed, OS-specific installation instructions for Oracle Instant Client and `libaio`. Double-check all environment variables, symbolic links, and dynamic library paths according to your OS.
Edit your system's `Path` environment variable. For example, `C:\instantclient_12_1\vc11;C:\instantclient_12_1` ensures correct DLL resolution. Restart your shell or IDE after changes.
Before installing `strong-oracle`, set `export GYP_DEFINES="oci_version=11"` (for bash/zsh) or `set GYP_DEFINES="oci_version=11"` (for Windows cmd) to match your Instant Client version, then reinstall the package (`npm rebuild strong-oracle`).
Verify that Oracle Instant Client is correctly installed and the `OCI_HOME`, `OCI_LIB_DIR`, `OCI_INCLUDE_DIR` environment variables are set. On Linux, ensure `LD_LIBRARY_PATH` (or `/etc/ld.so.conf.d/`) is configured. On MacOS, check `DYLD_LIBRARY_PATH`. On Windows, confirm `Path` includes the Instant Client directories (with correct order).
If using a `database` name, ensure it's a valid service name or SID. If using `tns`, verify the `tnsnames.ora` file is correctly configured, `TNS_ADMIN` environment variable points to its directory, and the alias exists and is spelled correctly. Try a full connection string directly in `connectData.tns`.
Install `libaio`: `sudo apt-get install libaio1` (Debian/Ubuntu) or `sudo yum install libaio` (Fedora/CentOS/RHEL).
Ensure the Visual Studio C++ Redistributable version corresponding to your Node.js build (e.g., VS2012 for OCI 12.1 as per README) is installed. Double-check the `Path` environment variable, specifically the order of `instantclient\vcXX` and `instantclient` entries as described in the warnings.