JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 4
  • Score
    100M100P100Q43232F
  • License MIT

Boilerplate Node.js middleware that facilitates connections and transactions with Oracle databases.

Package Exports

  • oracle-gopher

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (oracle-gopher) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

oracle-gopher

Boilerplate Node.js middleware that facilitates connections and transactions with Oracle databases.

Requirements

  • Node.js v0.10.28 (or greater)
  • Oracle Instant Client

Setup

A) Oracle Instant Client Download

  1. Download the following TWO Oracle Instant Client Packages (here: http://www.oracle.com/technetwork/database/features/instant-client/index-097480.html ). Please make sure to download the correct packages for your system architecture (i.e. 64 bit vs 32 bit)

    • Instant Client Package - Basic or Basic Lite: Contains files required to run OCI, OCCI, and JDBC-OCI applications

    • Instant Client Package - SDK: Contains additional header files and an example makefile for developing Oracle applications with Instant Client

B) Oracle Instant Client Installation and Configuration (this example procedure is for Mac OS X 64bit ONLY)

From a terminal window:

  1. Unzip files:
unzip instantclient-basic-macos.x64-11.2.0.4.0.zip -d /oracle
unzip instantclient-sdk-macos.x64-11.2.0.3.0.zip -d /oracle
  1. Update your .bashrc file by appending and saving the following block of code:
##### Oracle Instant Client 11.2 #####
OCI_HOME=/oracle/instantclient_11_2
OCI_LIB_DIR=$OCI_HOME
OCI_INC_DIR=$OCI_HOME/sdk/include
OCI_INCLUDE_DIR=$OCI_HOME/sdk/include
OCI_VERSION=11
DYLD_LIBRARY_PATH=$OCI_LIB_DIR
  1. Create the following symbolic links from within your Instant Client directory (e.g. /oracle/instantclient_11_2):
cd /oracle/instantclient_11_2
ln -s libclntsh.dylib.11.1 libclntsh.dylib
ln -s libocci.dylib.11.1 libocci.dylib
  1. Restart your Terminal application

C) oracle-gopher Installation

 npm install oracle-gopher

Usage

A) Example

var Gopher = require('oracle-gopher');
var pouch = {
   user              : "A_Valid_Username",   //mandatory
   password          : "A_Valid_Password",   //mandatory
   connectString     : "localhost:1521/ORCL",  //mandatory
   dbStatement       : "SELECT dummy FROM DUAL WHERE dummy = :DUMMYVALUE",   //manditory
   outputFormat      : "array",    //not mandatory. if not explicitly set, will default to json (the only other value permitted)
   maxRowsReturned   : 1,  //not mandatory. if not explicitly set, default is set to return up to 2000 rows
   bindVariables     : {DUMMYVALUE : "X"}  // not mandatory.  only when setting bind variables in dbStatement
   };
var gopher = new Gopher(pouch);

gopher.tunnel(
   function(err,result){
       if (err) {
           return console.log(err);
       }
       return console.log(result);
   }
);