Git Product home page Git Product logo

loopback-connector-oracle's Introduction

loopback-connector-oracle

Oracle is an object-relational database management system produced by Oracle Corporation. The loopback-connector-oracle module is the Oracle connector for the LoopBack framework based on the node-oracledb module.

Prerequisites

Node.js: The Oracle connector requires Node.js version 6.x and up.

Windows: On 32-bit Windows systems, you must use the 32-bit version of Node.js. On 64-bit Windows systems, you must use the 64-bit version of Node.js. For more information, see Node-oracledb Installation on Windows.

Oracle: The Oracle connector requires Oracle client libraries 11.2+ and can connect to Oracle Database Server 9.2+.

Installation

Before installing this module, please follow instructions at https://oracle.github.io/node-oracledb/INSTALL.html to make sure all the prerequisites are satisfied.

In your application root directory, enter this command to install the connector:

$ npm install loopback-connector-oracle --save

If you create a Oracle data source using the data source generator as described below, you don’t have to do this, since the generator will run npm install for you.

The libaio library is required on Linux systems:

On Ubuntu/Debian, get it with this command:

sudo apt-get install libaio1

On Fedora/CentOS/RHEL, get it with this command:

sudo yum install libaio

Creating an Oracle data source

For LoopBack 4 users, use the LoopBack 4 Command-line interface to generate a DataSource with Oracle connector to your LB4 application. Run lb4 datasource, it will prompt for configurations such as host, post, etc. that are required to connect to an Oracle database.

After setting it up, the configuration can be found under src/datasources/<DataSourceName>.datasource.ts, which would look like this:

const config = {
  name: "db",
  connector: "oracle",
  tns: "",
  host: "localhost",
  port: 1521,
  user: "admin",
  password: "pass",
  database: "XE",
};
For LoopBack 3 users

Use the Data source generator to add a Oracle data source to your application. The generator will prompt for the database server hostname, port, and other settings required to connect to a Oracle database. It will also run the npm install command above for you.

The entry in the application's /server/datasources.json will look like this:

{% include code-caption.html content="/server/datasources.json" %}

"mydb": {
  "name": "mydb",
  "connector": "oracle",
  "tns": "demo",
  "host": "myserver",
  "port": 1521,
  "database": "mydb",
  "password": "mypassword",
  "user": "admin"
 }

Edit <DataSourceName>.datasources.ts to add any other additional properties that you require.

Connector properties

The connector properties depend on naming methods you use for the Oracle database. LoopBack supports three naming methods:

  • Easy connect: host/port/database.
  • Local naming (TNS): alias to a full connection string that can specify all the attributes that Oracle supports.
  • Directory naming (LDAP): directory for looking up the full connection string that can specify all the attributes that Oracle supports.

Easy Connect

Easy Connect is the simplest form that provides out-of-the-box TCP/IP connectivity to databases. The data source then has the following settings.

Property Type Default Description
host or hostname String localhost Host name or IP address of the Oracle database server
port Number 1521 Port number of the Oracle database server
username or user String   User name to connect to the Oracle database server
password String   Password to connect to the Oracle database server
database String XE Oracle database listener name

For example (LB4 form):

{% include code-caption.html content="src/datasources/db.datasource.ts" %}

const config = {
  name: "db",
  connector: "oracle",
  host: "oracle-demo.strongloop.com",
  port: 1521,
  user: "admin",
  password: "pass",
  database: "XE",
};

Local and directory naming

Both local and directory naming require that you place configuration files in a TNS admin directory, such as /oracle/admin.

sqlnet.ora

This specifies the supported naming methods; for example:

NAMES.DIRECTORY_PATH=(LDAP,TNSNAMES,EZCONNECT)

nsnames.ora

This maps aliases to connection stringsl for example:

demo1=(DESCRIPTION=(CONNECT_DATA=(SERVICE_NAME=))(ADDRESS=(PROTOCOL=TCP)(HOST=demo.strongloop.com)(PORT=1521)))

ldap.ora

This configures the LDAP server.

DIRECTORY_SERVERS=(localhost:1389)
DEFAULT_ADMIN_CONTEXT="dc=strongloop,dc=com"
DIRECTORY_SERVER_TYPE=OID

Set up TNS_ADMIN environment variable

For the Oracle connector to pick up the configurations, you must set the environment variable 'TNS_ADMIN' to the directory containing the .ora files.

export TNS_ADMIN=<directory containing .ora files>

Now you can use either the TNS alias or LDAP service name to configure a data source:

const config = {
  name: "db",
  connector: "oracle",
  tns: "demo", // The tns property can be a tns name or LDAP service name
  username: "demo",
  password: "L00pBack",
});

Connection pooling options

Property name Description Default value
minConn Minimum number of connections in the connection pool 1
maxConn Maximum number of connections in the connection pool 10
incrConn

Incremental number of connections for the connection pool.

1
timeout Time-out period in seconds for a connection in the connection pool. The Oracle connector will terminate connections in this connection pool that are idle longer than the time-out period. 10

For example,

{% include code-caption.html content="src/datasources/db.datasource.ts" %}

const config = {
  name: "db",
  connector: "oracle",
  minConn:1,
  maxConn:5,
  incrConn:1,
  timeout: 10,
  ...
};

Connection troubleshooting

If you encounter this error:

Error: ORA-24408: could not generate unique server group name

Then the Oracle 11g client requires an entry with your hostname pointing to 127.0.0.1.

To resolve:

Get your hostname. Check your hostname by running this command (for example, if your machine's name is "earth"):

$ hostname
earth

Update /etc/hosts and map 127.0.0.1 to your hostname "earth":

...
127.0.0.1 localhost earth
...

Verify the fix. Run the app:

$ npm start

For more information, see StackOverflow question.

How LoopBack models map to Oracle tables

There are several properties you can specify to map the LoopBack models to the existing tables in the Oracle database:

Model definition maps to Oracle schema/table

  • oracle.schema: the schema name of the table
  • oracle.table: the table name of the model

Property definition maps to Oracle column

  • oracle.columnName: the column name of the property
  • oracle.dataType: the type of the column

(Check out more available database settings in the section Data mapping properties.)

The following example model User maps to the table USER under schema XE in the database with its columns:

{% include code-caption.html content="/models/user.model.ts" %}

@model({
  settings: {
    oracle: {
      schema: 'XE',
      table: 'USER'
    }
  }
})
export class User extends Entity {
  @property({
    type: 'number',
    required: true,
    id: true,
    oracle: {
      columnName: 'ID',
      dataType: 'NUMBER',
      nullable: 'N'
    },
  })
  id: number;

  @property({
    type: 'string',
    required: true,
    oracle:{
      columnName: 'LOCALTIONID',
      dataType: 'VARCHAR2',
      nullable: 'N'
    }
  })
  locationId: string;
For LoopBack 3 users

{% include code-caption.html content="/common/models/model.json" %}

{
    "name":"User",
    "options":{
      "idInjection":false,
      "oracle":{
        "schema":"XE",
        "table":"USER"
      }
    },
    "properties":{
      "myId":{
        "type":"number",
        "required":true,
        "id":1,
        "oracle":{
          "columnName":"MYID",
          "dataType":"NUMBER",
        }
      },
      "locationId":{
        "type":"String",
        "required":true,
        "length":20,
        "id":2,
        "oracle":{
          "columnName":"LOCATION_ID",
          "dataType":"VARCHAR2",
          "dataLength":20,
          "nullable":"N"
        }
      },
    }
  }

Notice: the Oracle database default type is UPPERCASE. If the oracle settings are not specified in the model, for example:

export class Demo extends Entity {
  @property({
    type: 'number',
    required: true,
    id: true,
  })
  id: number;

the connector would look for a table named DEMO under the default schema in the database and also map the id property to a column named ID in that table. This might cause errors if the default table/colum name doesn't exist. Please do specify the settings if needed.

Configure a custom table/column name

On the other hand, such settings would also allow you to have different names for models and tables. Take the User model as an example, we can map the User model to the table MYUSER and map the id property to column MY_IDas long as they are specified correctly:

@model({
  settings: {
    oracle: {
      schema: 'XE',
      table: 'MYUSER' // customized name
    }
  }
})
export class User extends Entity {
  @property({
    type: 'number',
    required: true,
    id: true,
    oracle: {
      columnName: 'MYID' // customized name
    },
  })
  id: number;
  //...
For LoopBack 3 users
{
    "name":"User",
    "options":{
      "idInjection":false,
      "oracle":{
        "schema":"XE",
        "table":"MYUSER" // customized name
      }
    },
    "properties":{
      "id":{
        "type":"number",
        "required":true,
        "id":1,
        "oracle":{
          "columnName":"MYID", // customized name
          "dataType":"NUMBER",
        }
      },
      //...
    }
  }

Type mapping

See LoopBack 4 types (or LoopBack 3 types) for details on LoopBack's data types.

JSON to Oracle Types

LoopBack Type Oracle Type
String
JSON
Text
default
VARCHAR2
Default length is 1024
Number NUMBER
Date DATE
Timestamp TIMESTAMP(3)
Boolean CHAR(1)

Oracle Types to JSON

Oracle Type LoopBack Type
CHAR(1) Boolean
CHAR(n)
VARCHAR
VARCHAR2,
LONG VARCHAR
NCHAR
NVARCHAR2
String
LONG, BLOB, CLOB, NCLOB Node.js Buffer object
NUMBER
INTEGER
DECIMAL
DOUBLE
FLOAT
BIGINT
SMALLINT
REAL
NUMERIC
BINARY_FLOAT
BINARY_DOUBLE
UROWID
ROWID
Number
DATE
TIMESTAMP
Date

Discovery and auto-migration

Model discovery

The Oracle connector supports model discovery that enables you to create LoopBack models based on an existing database schema. Once you defined your datasource:

Auto-migration

The Oracle connector also supports auto-migration that enables you to create a database schema from LoopBack models.

For example, based on the following model, the auto-migration method would create/alter existing CUSTOMER table under XE schema in the database. Table CUSTOMER would have two columns: NAME and ID, where ID is also the primary key, and its value would be generated by the database as it has type: 'Number' and generated: true set:

@model()
export class Customer extends Entity {
  @property({
    id: true,
    type: 'Number',
    generated: true
  })
  id: number;

  @property({
    type: 'string'
  })
  name: string;
}
For LoopBack 3 users
{
    "name":"Customer",
    "options":{
      "idInjection":false,
    },
    "properties":{
      "id":{
        "type":"number",
        "required":true,
        "id":1,
      },
      "name":{
        "type":"string",
        "required":false,
      },
    }
  }

LoopBack Oracle connector creates the following schema objects for a given model:

  • A table, for example, PRODUCT
  • A sequence for the primary key, for example, PRODUCT_ID_SEQUENCE
  • A trigger to generate the primary key from the sequence, for example, PRODUCT_ID_TRIGGER

Specifying database schema definition via model

By default, table and column names are generated in uppercase.

Besides the basic model metadata, you can also to specify part of the database schema definition via the property definition then run the migration script. They will be mapped to the database. The setting is the same as what we introduced in the section Configure a custom table/column name. One just needs to create models first, then run the migration script.

For how to run the script and more details:

(See LoopBack auto-migrate method for related APIs information)

Here are some limitations and tips:

  • If you defined generated: true in the id property, it generates integers by default. The Oracle connector does not support other auto-generated id types yet. Please check the Auto-generated ids section below if you would like use auto-generated id in different types such as uuid.
  • Only the id property supports the auto-generation setting generated: true for now
  • Destroying models may result in errors due to foreign key integrity. First delete any related models by calling delete on models with relationships.

Auto-generated ids

Auto-migrate supports the automatic generation of property values for the id property. For Oracle, the default id type is integer. Thus if you have generated: true set in the id property definition, it generates integers by default:

{
  id: true,
  type: 'Number',
  required: false,
  generated: true // enables auto-generation
}

It might be a case to use UUIDs as the primary key in Oracle instead of integers. You can enable it with either the following ways:

  • use uuid that is generated by your LB application by setting defaultFn: uuid:
  @property({
    id: true,
    type: 'string'
    defaultFn: 'uuid',
    // generated: true,  -> not needed
  })
  id: string;
  • alter the table to use Oracle built-in uuid functions (SYS_GUID() for example):
  @property({
  id: true,
  type: 'String',
  required: false,
  // settings below are needed
  generated: true,
  useDefaultIdType: false,
})
  id: string;

Then you will need to alter the table manually.

Running tests

Own instance

If you have a local or remote Oracle instance and would like to use that to run the test suite, use the following command:

  • Linux
ORACLE_HOST=<HOST> ORACLE_PORT=<PORT> ORACLE_USER=<USER> ORACLE_PASSWORD=<PASSWORD> ORACLE_DATABASE=<DATABASE> npm test
  • Windows
SET ORACLE_HOST=<HOST>
SET ORACLE_PORT=<PORT>
SET ORACLE_USER=<USER>
SET ORACLE_PASSWORD=<PASSWORD>
SET ORACLE_DATABASE=<DATABASE>
npm test

Docker

If you do not have a local Oracle instance, you can also run the test suite with very minimal requirements.

  • Assuming you have Docker installed, run the following script which would spawn an Oracle instance on your local machine:
source setup.sh <HOST> <PORT>

where <HOST>, <PORT>, <USER>, and PASSWORD are optional parameters. The default values are localhost, 1521, admin, and 0raclep4ss respectively. The DATABASE setting is always XE.

  • Run the test:
npm test

loopback-connector-oracle's People

Contributors

0candy avatar agnes512 avatar ataft avatar b-admike avatar bajtos avatar candytangnb avatar cgole avatar crandmck avatar dhmlau avatar duffn avatar emonddr avatar ericalves avatar gunjpan avatar jannyhou avatar joostdebruijn avatar kallenboone avatar loay avatar lulinqing avatar nabdelgadir avatar rashmihunt avatar raymondfeng avatar ritch avatar rmg avatar sam-github avatar shovon avatar siddhipai avatar simonhoibm avatar ssh24 avatar superkhau avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

loopback-connector-oracle's Issues

Cannot use locally compiled strong-oracle and no package available?

Since loopback-connector-oracle now uses loopback-oracle-installer to download and install strong-oracle, is there no way to use strong-oracle without building it and hosting it in some location for it to download?

strong-oracle seems to build and work fine on my El Capitan machine (despite the warning in the docs) yet the URL at which loopback-oracle-installer tries to download the package (http://7e9918db41dd01dbf98e-ec15952f71452bc0809d79c86f5751b6.r22.cf1.rackcdn.com/loopback-oracle-MacOSX-x64-abi47-1.5.0.tar.gz) is a 404.

Handling number presicion

Hello,

How should I go about handling money and currency from Oracle DBs? I have a table with the following column defined:
PRICE NUMBER(15,2)

And a row with a price of 38.73. With the following configuration in Strongloop:

    "price": {
      "type": "Number",
      "required": true,
      "oracle": {
        "columnName": "PRICE",
        "dataType": "NUMBER",
        "dataLength": 15
      }
    }

I get the following value when making a get request: "price":38.730000000000004

Am I missing something in my configuration that would be able to handle this?

LoopBack connector "oracle" is not installed (but it is) - UBUNTU

Something is very wrong with the install procedure. I cannot seem to get it to work.

Firstly, no strong-oracle.rc file is generated (even though the install script says it is)...

Notice the first few lines in the output below (the install.sh script is erroring with bad substitution, yet the script happily announces the file was generated...)

> [email protected] install /vagrant/node_modules/loopback-connector-oracle/node_modules/loopback-oracle-installer
> node pkginstall.js

Downloading/Extracting http://7e9918db41dd01dbf98e-ec15952f71452bc0809d79c86f5751b6.r22.cf1.rackcdn.com/loopback-oracle-Linux-x64-abi14-1.5.0.tar.gz
http://7e9918db41dd01dbf98e-ec15952f71452bc0809d79c86f5751b6.r22.cf1.rackcdn.com/loopback-oracle-Linux-x64-abi14-1.5.0.tar.gz is now extracted to /vagrant/node_modules/loopback-connector-oracle/node_modules
/vagrant/node_modules/loopback-connector-oracle/node_modules/loopback-oracle-installer/bin/installers/Linux/installer.sh: 5: /vagrant/node_modules/loopback-connector-oracle/node_modules/loopback-oracle-installer/bin/installers/Linux/installer.sh: Bad substitution
/vagrant/node_modules/loopback-connector-oracle/node_modules/loopback-oracle-installer/bin/installers/Linux/installer.sh: 7: /vagrant/node_modules/loopback-connector-oracle/node_modules/loopback-oracle-installer/bin/installers/Linux/installer.sh: source: not found
/vagrant/node_modules/loopback-connector-oracle/node_modules/loopback-oracle-installer/bin/installers/Linux/installer.sh: 9: /vagrant/node_modules/loopback-connector-oracle/node_modules/loopback-oracle-installer/bin/installers/Linux/installer.sh: setup_configuration: not found
-------------------------------------------------------------------------------
"strong-oracle.rc" has been created in $HOME. Please manually add the
following to your ".bash_profile":

  source /home/vagrant/strong-oracle.rc

If you do not use bash as your default shell, please remember to set
$LD_LIBRARY_PATH prior to using node:

  export LD_LIBRARY_PATH=":/vagrant/node_modules/loopback-connector-oracle/node_modules/instantclient"

The node-oracle module and Oracle specific libraries have been installed in
/vagrant/node_modules/loopback-connector-oracle/node_modules/loopback-oracle-installer. Alternatively, you can add that path to /etc/ld.so.conf (sudo required):

  echo "/vagrant/node_modules/loopback-connector-oracle/node_modules/instantclient" | sudo tee -a /etc/ld.so.conf.d/loopback_oracle.conf
  sudo ldconfig

-------------------------------------------------------------------------------
[email protected] node_modules/loopback-connector-oracle
├── [email protected]
├── [email protected]
├── [email protected] ([email protected])
├── [email protected] ([email protected], [email protected])
├── [email protected] ([email protected])
└── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected])

So, then I figured I could manually export the LD_LIBRARY_PATH variable and run the app, to no avail. Then I tried manually creating the strong-oracle.rc file and adding the export to that file (and sourcing)... no luck.

No matter what I've tried, we keep getting the following:

Error: 
WARNING: LoopBack connector "oracle" is not installed as any of the following modules:

 ./connectors/oracle
loopback-connector-oracle

To fix, run:

    npm install loopback-connector-oracle

    at DataSource.setup (/vagrant/node_modules/loopback-datasource-juggler/lib/datasource.js:294:28)
    at new DataSource (/vagrant/node_modules/loopback-datasource-juggler/lib/datasource.js:101:8)
    at Registry.createDataSource (/vagrant/node_modules/loopback/lib/registry.js:323:12)
    at dataSourcesFromConfig (/vagrant/node_modules/loopback/lib/application.js:386:19)
    at EventEmitter.app.dataSource (/vagrant/node_modules/loopback/lib/application.js:221:12)
    at /vagrant/node_modules/loopback-boot/lib/executor.js:158:9
    at /vagrant/node_modules/loopback-boot/lib/executor.js:228:5
    at Array.forEach (native)
    at forEachKeyedObject (/vagrant/node_modules/loopback-boot/lib/executor.js:227:20)
    at setupDataSources (/vagrant/node_modules/loopback-boot/lib/executor.js:157:3)

Create on a model without id

Hello,

I created the model of a table that doesn't have primary key with the "discoverAndBuildModels" method of loopback-datasource-juggler.

When I tried to do a create with the generated model, I get the following error:
TypeError: Cannot read property 'type' of undefined

At this line in oracle.js:
330 var type = this._models[model].properties[this.idName(model)].type;
Because "this.idName(model)" returns undefined.

Is there a way to do a create without a PK? Do I need to modify something in the generated model?

Thanks.

Meet ORA-03134 error when connect to an oracle 10g server on Ubuntu 14.04

when i deploy my api service to an ubuntu 14.04 server and try to connect to an oracle 10g server by this connector, it caused the error as following:
ORA-03134: Connections to this server version are no longer supported.

The reason is when i run npm install loopback-connector-oracle, the loopback-oracle-installer installed the oracle instantsclient 12_1 as default, and oracle documents show that 12_1 client no longer supports the 10g server and below.

I wonder if i can use oracle client 11_2 as the connector. i had tried to dowload and setup the instantsclient11_2 manually by following the instruction of Strong-Oracle, but it shows no 'oracle' connector installed. is there any way that i can connect to the oracle 10g server on ubuntu?

StrongLoop Enterprise Connector

As everybody knows Strongloop uses this open source connector as bridge to oracle data, but i got a question. In the page of pricing of strongloop it says that the Open Source Drivers are free, but they have a Enterprise Connectors section in that section they manage Oracle.

Does the Loopback oracle connector is the same as the enterprise connector from LoopBack?

Can anyone has a project with Strongloop using this driver ? do you pay for it ?

Thanks in advance.

Type Coercion for String to RAW

Loopback-connector-oracle 3.0 (master) has partial support for RAW data types; if a loopback property is set with the type "string" and contains hexadecimal, the Oracle database engine will coerce it to RAW.

However, this conversion occurs after the queryplan is established - comparing an indexed RAW column to a hexadecimal string (such as a UUID) will cause a table scan - no indexes are ever used. The proper Oracle workaround is to place "hextoraw" in the query so that Oracle's queryplan is correctly comparing raw to raw.

What I propose is that the loopback-oracle-connector toColumnValue function look at the oracle.dataType parameter to determine whether we are coercing to RAW and then wrap the argument in the hextoraw function. We use RAW(16) UUIDs as our primary keys - we are seeing 3000ms+ queries in loopback by default, with < 20ms once we manually made this change.

The change is simple - in oracle.js of loopback-connector-oracle, change the "if (prop.type == String)" to something similar to this:

  if (prop.type === String) {
    if (prop.oracle && prop.oracle.dataType === "RAW") {
      return new ParameterizedSQL("hextoraw(?)", [val]);
    }

    return String(val);
  }

I'm willing to submit a pull request, but I believe your unit tests only run in Mac/Linux.

Unable to Discover Oracle Models using ARC Composer

When attempting to discover models using slc arc and the oracle connector, the cursor on the window spins for about 2 minutes and then returns an empty list instead of a populated table list.

The connection within composer tests successfully for both the Oracle datasource and the Postgresql datasource. Discover models works successfully for the Postgresql datasource but not the Oracle datasource.

This might very well be an ARC Composer issue, but starting here since it only manifests when trying to use the oracle connector.

Steps to reproduce:

  1. create a new loopback project using
    $ slc loopback connectortest
  2. cd connectortest
  3. npm install --save loopback-connector-postgresql
  4. npm install --save loopback-connector-oracle
    complete the oracle connector installation
  5. cd node_modules/loopback-connector-oracle
  6. npm install
  7. change directory back to project home directory
  8. slc arc
  9. login to ARC console and navigate to composer
  10. add datasource for both oracle and postgresql
  11. try to discover models

Additional info: I can discover the Oracle models successfully by invoking the API call directly. Test javascript attached.

test_oracle_discovery_script.txt
test_oracle_discovery_output.txt
screen shot 2016-01-07 at 4 08 15 pm
screen shot 2016-01-07 at 4 12 32 pm

ENVIRONMENT INFO:

OS X Yosemite version 10.10.5
node v5.4.0
strongloop v6.0.0 (node v5.4.0)
├── [email protected] (d01942e)
├── [email protected] (47dd24a)
├── [email protected] (be6180a)
├── [email protected] (62e539b)
├── [email protected] (eb2f788)
├── [email protected] (f46e58f)
├── [email protected] (1327018)
├─┬ [email protected] (1e39220)
│ └── [email protected] (4ea7ee9)
├── [email protected] (a884c0b)
├── [email protected]
└── [email protected]

[email protected]
[email protected]

npm install loopback-connector-oracle zlib issue on ubuntu 14.x & RH 7

/home/nodebot/testpm12
$ cd ..
$ cd testarc12
$ npm install loopback-connector-oracle --save
\

[email protected] install /home/nodebot/testarc12/node_modules/l oopback-connector-oracle/node_modules/loopback-oracle-installer
node pkginstall.js

Downloading/Extracting http://7e9918db41dd01dbf98e-ec15952f71452bc0809d79c86f575 1b6.r22.cf1.rackcdn.com/loopback-oracle-Linux-ppc64-abi14-1.5.0.tar.gz
events.js:85
throw er; // Unhandled 'error' event
^
Error: incorrect header check
at Zlib._handle.onerror (zlib.js:366:17)
npm ERR! Linux 3.13.0-45-generic
npm ERR! argv "/home/nodebot/IBMSVT64_12/bin/node" "/home/nodebot/IBMSVT64_12/bi n/npm" "install" "loopback-connector-oracle" "--save"
npm ERR! node v0.12.7
npm ERR! npm v2.11.3
npm ERR! code ELIFECYCLE

npm ERR! [email protected] install: node pkginstall.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script 'node pkgi nstall.js'.
npm ERR! This is most likely a problem with the loopback-oracle-installer packag e,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node pkginstall.js
npm ERR! You can get their info via:
npm ERR! npm owner ls loopback-oracle-installer
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! /home/nodebot/testarc12/npm-debug.log
$ ^C
$

detailed
https://gist.github.com/smartmouse/f97f1de02e0ba9b5fa25

same issue ppcLE RH 7

https://gist.github.com/smartmouse/eef4cdd8f5542abc4c11

Change "... your PATH has been modified..." message to "Please modify your PATH to include..."

After running npm install loopback-connector-oracle, you get a message saying ...your path has been modified..., which is a deprecated feature from LoopBack 1.x

We should change this to read ...Please modify your path to include oracle.rc, ie) export PATH="oracle.rc:$PATH"... or something along those lines.

Adding to the path automatically raised concerns about being too invasive and so the feature was removed in LoopBack 2.x. Maybe a better solution to this is to build some sort of option/flag during the install to allow the user to choose whether they want this added to the path for them. Not sure if this is possible with NPM though.

CI failing due to libaio.so not being found

> ./run-tests

/home/jenkins/workspace/ds/loopback-connector-oracle~master/node_modules/oracledb/lib/oracledb.js:37
    throw err;
    ^

Error: libaio.so.1: cannot open shared object file: No such file or directory

install issue

Hi,

While trying to install the connector with Node (v0.12.0) and npm (v2.9.1), i am getting the following error

C:\TD\USTS\NodeWorkspaces\DBConnect>npm install loopback-connector-oracle --save

\

[email protected] install C:\TD\USTS\NodeWorkspaces\DBConnect\no
de_modules\loopback-connector-oracle\node_modules\loopback-oracle-installer
node pkginstall.js

Downloading/Extracting http://7e9918db41dd01dbf98e-ec15952f71452bc0809d79c86f575
1b6.r22.cf1.rackcdn.com/loopback-oracle-Windows-x86-abi14-1.5.0.tar.gz
events.js:85
throw er; // Unhandled 'error' event
^
Error: incorrect header check
at Zlib._handle.onerror (zlib.js:366:17)
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "node" "C:\Users\Redirection\arathor\AppData\npm\node_module
s\npm\bin\npm-cli.js" "install" "loopback-connector-oracle" "--save"
npm ERR! node v0.12.0
npm ERR! npm v2.9.1
npm ERR! code ELIFECYCLE

npm ERR! [email protected] install: node pkginstall.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script 'node pkgi
nstall.js'.
npm ERR! This is most likely a problem with the loopback-oracle-installer packag
e,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node pkginstall.js
npm ERR! You can get their info via:
npm ERR! npm owner ls loopback-oracle-installer
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! C:\TD\USTS\NodeWorkspaces\DBConnect\npm-debug.log

Windows Issues Oracle Connector not available

Having Issues when working with Windows 7.

I keep trying to setup a basic project but cant get the oracle side to work. I have tried using oracle installer, but nothing seems to work on windows ( linux machine I had no problems :) ).

On windows I constantly keep getting that the ' LoopBack connector "oracle" is not installed as any of the following modules:'


WARNING: LoopBack connector "oracle" is not installed as any of the following modules:

./connectors/oracle
loopback-connector-oracle

To fix, run:

npm install loopback-connector-oracle

events.js:72
throw er; // Unhandled 'error' event


So I run the necessary command ;

c:\development\neil-strong-loop\testapp>npm install loopback-connector-oracle
npm WARN package.json [email protected] No description
npm WARN package.json [email protected] No repository field.
npm WARN package.json [email protected] No README data
[email protected] node_modules\loopback-connector-oracle
├── [email protected]
├── [email protected]
├── [email protected]
└── [email protected] ([email protected])

Still nothing seems to work but files seems to be in the project directory.

Is there anything else I can try.... ( Ive tried loopback-oracle-installer and I still end up with oracle connector error ).

Cheers

Neil

connector install failed on MAC OSX

Dear, I have downloaded and configured the strong-oracle following the guide.
then run npm install loopback-connector-oracle --save and got following error.
image
seems build error. Please help . Thanks.
the following is the debug log: the log is too long, i only pasted the error part.

6676 verbose about to build /Users/swizard/Documents/dev/strongloop/node_modules/loopback-connector-oracle
6677 verbose unlock done using /Users/swizard/.npm/_locks/loopback-connector-oracl-a5c44909a0f9120a.lock for /Users/swizard/Documents/dev/strongloop/node_modules/loopback-connector-oracle
6678 verbose stack Error: [email protected] install: node pkginstall.js
6678 verbose stack Exit status 1
6678 verbose stack at EventEmitter. (/Users/swizard/.nvm/versions/io.js/v2.5.0/lib/node_modules/npm/lib/utils/lifecycle.js:214:16)
6678 verbose stack at emitTwo (events.js:87:13)
6678 verbose stack at EventEmitter.emit (events.js:172:7)
6678 verbose stack at ChildProcess. (/Users/swizard/.nvm/versions/io.js/v2.5.0/lib/node_modules/npm/lib/utils/spawn.js:24:14)
6678 verbose stack at emitTwo (events.js:87:13)
6678 verbose stack at ChildProcess.emit (events.js:172:7)
6678 verbose stack at maybeClose (internal/child_process.js:764:16)
6678 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
6679 verbose pkgid [email protected]
6680 verbose cwd /Users/swizard/Documents/dev/strongloop
6681 error Darwin 14.5.0
6682 error argv "/Users/swizard/.nvm/versions/io.js/v2.5.0/bin/iojs" "/Users/swizard/.nvm/versions/io.js/v2.5.0/bin/npm" "install" "loopback-connector-oracle" "--save"
6683 error node v2.5.0
6684 error npm v2.13.2
6685 error code ELIFECYCLE
6686 error [email protected] install: node pkginstall.js
6686 error Exit status 1
6687 error Failed at the [email protected] install script 'node pkginstall.js'.
6687 error This is most likely a problem with the loopback-oracle-installer package,
6687 error not with npm itself.
6687 error Tell the author that this fails on your system:
6687 error node pkginstall.js
6687 error You can get their info via:
6687 error npm owner ls loopback-oracle-installer
6687 error There is likely additional logging output above.
6688 verbose exit [ 1, true ]
6689 verbose unbuild node_modules/loopback-connector-oracle/node_modules/loopback-oracle-installer
6690 info preuninstall [email protected]
6691 info uninstall [email protected]
6692 verbose unbuild rmStuff [email protected] from /Users/swizard/Documents/dev/strongloop/node_modules
6693 verbose unbuild rmStuff in /Users/swizard/Documents/dev/strongloop/node_modules/loopback-connector-oracle/node_modules
6694 info postuninstall [email protected]
6695 silly gentlyRm /Users/swizard/Documents/dev/strongloop/node_modules/loopback-connector-oracle/node_modules/loopback-oracle-installer is being purged from base /Users/swizard/Documents/dev/strongloop
6696 verbose gentlyRm don't care about contents; nuking /Users/swizard/Documents/dev/strongloop/node_modules/loopback-connector-oracle/node_modules/loopback-oracle-installer
6697 silly vacuum-fs purging /Users/swizard/Documents/dev/strongloop/node_modules/loopback-connector-oracle/node_modules/loopback-oracle-installer
6698 silly vacuum-fs quitting because other entries in /Users/swizard/Documents/dev/strongloop/node_modules/loopback-connector-oracle/node_modules
6699 verbose unbuild node_modules/loopback-connector-oracle
6700 info preuninstall [email protected]
6701 info uninstall [email protected]
6702 verbose unbuild rmStuff [email protected] from /Users/swizard/Documents/dev/strongloop/node_modules
6703 info postuninstall [email protected]
6704 silly gentlyRm /Users/swizard/Documents/dev/strongloop/node_modules/loopback-connector-oracle is being purged from base /Users/swizard/Documents/dev/strongloop
6705 verbose gentlyRm don't care about contents; nuking /Users/swizard/Documents/dev/strongloop/node_modules/loopback-connector-oracle
6706 silly vacuum-fs purging /Users/swizard/Documents/dev/strongloop/node_modules/loopback-connector-oracle
6707 silly vacuum-fs quitting because other entries in /Users/swizard/Documents/dev/strongloop/node_modules

Support latest version(s) of Node.js.

When can we expect compatibility with more recent versions of Node.js (ie: 4.2.2 and/or 5.1.0)?

Maintaining a legacy version of Node.js just for the Oracle connector adds complexity to the development process and the provisioning of production systems. It seems reasonable to expect the connector to stay relatively current with the most recent version of Node.js, in the same manner the rest of the StrongLoop ecosystem does.

connector not detected when running through an IDE

If I run an app from the command line, everything seems to work fine. But if I use Intellij for example, then the errors about the connector not being installed crop up:

WARNING: LoopBack connector "oracle" is not installed as any of the following modules:

./connectors/oracle
loopback-connector-oracle

To fix, run:

npm install loopback-connector-oracle

/.../Development/Learning/hello-world/node_modules/loopback/lib/application.js:238
throw err;
^

Error: Cannot create data source "oracle":
WARNING: LoopBack connector "oracle" is not installed as any of the following modules:

./connectors/oracle
loopback-connector-oracle

To fix, run:

npm install loopback-connector-oracle

at DataSource.setup (/.../Development/Learning/hello-world/node_modules/loopback-datasource-juggler/lib/datasource.js:309:28)
at new DataSource (/.../Development/Learning/hello-world/node_modules/loopback-datasource-juggler/lib/datasource.js:114:8)
at Registry.createDataSource (/.../Development/Learning/hello-world/node_modules/loopback/lib/registry.js:349:12)
at dataSourcesFromConfig (/.../Development/Learning/hello-world/node_modules/loopback/lib/application.js:430:19)
at EventEmitter.app.dataSource (/.../Development/Learning/hello-world/node_modules/loopback/lib/application.js:228:14)
at /.../Development/Learning/hello-world/node_modules/loopback-boot/lib/executor.js:178:9
at /.../Development/Learning/hello-world/node_modules/loopback-boot/lib/executor.js:269:5
at Array.forEach (native)
at forEachKeyedObject (/.../Development/Learning/hello-world/node_modules/loopback-boot/lib/executor.js:268:20)
at setupDataSources (/.../Learning/hello-world/node_modules/loopback-boot/lib/executor.js:173:3)

Node v4.4.3
OSX 10.11.4
loopback-connector-oracle 2.4.1

Unable to install Loop Back Oracle Module.

Trying to install Loopback oracle module on Windows 8.1 x64 Box.
Facing an error.
Error: Prebuilt tarball not found for your node version and platform: http://7e
918db41dd01dbf98e-ec15952f71452bc0809d79c86f5751b6.r22.cf1.rackcdn.com/loopback
oracle-Windows-x64-abi48-1.8.0.tar.gz

Is there a way to resolve this issue.
node.js version is v6.2.2
npm version is 3.9.5

Trying to install Strong-Oracle directly fails with Windows 8.1 SDK missing. I donot want to pursue this option.
Any pointers? c:\oracle\instantclient is present in the path

Windows system variables

Hello,

When I installed the project, "instantclient\vc11" and "instantclient" directories were automatically added to the User variable PATH. When I tried to execute "example/app.js", I had the following error:

$ node example/app.js

D:\userfiles\vincent.bourgeois\Documents\loopback-connector-oracle\lib\oracle.js:11
throw err;
^
Error: The specified procedure could not be found.
D:\userfiles\vincent.bourgeois\Documents\loopback-connector-oracle\node_modules\strong-oracle\build\Release\oracle_bindings.node
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object. (D:\userfiles\vincent.bourgeois\Documents\loopback-connector-oracle\node_modules\strong-oracle\lib\oracle.js:4:14)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)

I had to add the 2 directories to the System variable Path manually for the example to work.
I don't know if you can automate it, but it took me some time to find the issue, so maybe it could be helpful if you add this to the doc.

Thanks.

Allow customization of CHAR to String coercion

The loopback-oracle-connector currently hard-codes the strings that boolean values coerce to and from.

  • Coming from a column value, Y, y, T, t, 1, and 0 are supported.
  • Going to a column value, only Y and N are supported.

In our case, we've standardized on 1/0 for our CHAR(1) 'boolean-like' columns and have other consumers besides loopback using the database. The ability to configure how booleans coerce to strings is needed for porting existing applications.

Perhaps it could go inside the options.oracle object at both the model and property levels? My naming isn't very creative today, but something like this:

"options": { "oracle": { "boolTrue": "1", "boolFalse": "0" } }

troubles in discover models

hi, i'm using slc arc to create an oracle datasources.i get some troubles.
1.discover is pending when the number of models is too large, more then 100 tables.
2.can't discover other owner's table.

[email protected] Installation failing

Hi,

I am getting following error while running

npm install loopback-connector-oracle --save in Windows 7 64 bit.

I encountered this error few hours before. Earlier, I was not getting any exception during installation. I also tried to clear cache at C:\Users\atiw26\AppData\Roaming\npm-cache and fired the same installation command. But still getting this error.

I had to reinstall this package because of another error during the execution of sample for Oracle Connectors.

npm-debug.zip

I am attaching the logs which are generated during the Oracle Connector installation.

Asking for license

Can i use this connector to produce a comercial product for free?

A) With te use of strongloop
B) only With loopback

Thank you in advance

Publish version 3.0.0 to NPM

The latest changes in /master to support a direct dependency against the official Oracle driver (node-oracledb) aren't published to NPM as an alpha version yet.

Would it be possible to branch loopback-connector-oracle to a 3.x-latest" branch and then publish it as a pre-release alpha version to npm? The last non-documentation and non-globalization checkin was back in May.

We'd like to use the 3.x form of loopback-connector-oracle shortly after Loopback 3 when it's released - how stable is the new connector, and what's needed to get it complete?

Fix CI failure observed in loopback-datasource-juggler

as a dependant of loopback-datasource-juggler, oracle fails in juggler pr's CI tests:

/home/jenkins/workspace/ds/loopback-connector-oracle~master/node_modules/oracledb/lib/oracledb.js:37
    throw err;
    ^

Error: libaio.so.1: cannot open shared object file: No such file or directory
    at Error (native)
    at Object.Module._extensions..node (module.js:434:18)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
    at Module.require (module.js:353:17)
    at require (internal/module.js:12:17)
    at Object.<anonymous> (/home/jenkins/workspace/ds/loopback-connector-oracle~master/node_modules/oracledb/lib/oracledb.js:32:19)
    at Module._compile (module.js:409:26)
    at Object.Module._extensions..js (module.js:416:10)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
    at Module.require (module.js:353:17)
    at require (internal/module.js:12:17)
    at Object.<anonymous> (/home/jenkins/workspace/ds/loopback-connector-oracle~master/node_modules/oracledb/index.js:1:80)
    at Module._compile (module.js:409:26)
    at Object.Module._extensions..js (module.js:416:10)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
    at Module.require (module.js:353:17)
    at require (internal/module.js:12:17)
    at Object.<anonymous> (/home/jenkins/workspace/ds/loopback-connector-oracle~master/lib/oracle.js:12:14)
    at Module._compile (module.js:409:26)
    at Object.Module._extensions..js (module.js:416:10)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
    at Module.require (module.js:353:17)
    at require (internal/module.js:12:17)
    at Object.<anonymous> (/home/jenkins/workspace/ds/loopback-connector-oracle~master/index.js:9:18)
    at Module._compile (module.js:409:26)
    at Object.Module._extensions..js (module.js:416:10)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
    at Module.require (module.js:353:17)
    at require (internal/module.js:12:17)
    at global.getDataSource.global.getSchema (/home/jenkins/workspace/ds/loopback-connector-oracle~master/test/init/init.js:18:23)
    at Suite.<anonymous> (/home/jenkins/workspace/ds/loopback-connector-oracle~master/node_modules/loopback-datasource-juggler/test/manipulation.test.js:878:8)
    at context.describe.context.context (/home/jenkins/workspace/ds/loopback-connector-oracle~master/node_modules/mocha/lib/interfaces/bdd.js:47:10)
    at Object.<anonymous> (/home/jenkins/workspace/ds/loopback-connector-oracle~master/node_modules/loopback-datasource-juggler/test/manipulation.test.js:16:1)
    at Module._compile (module.js:409:26)
    at Object.Module._extensions..js (module.js:416:10)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
    at Module.require (module.js:353:17)
    at require (internal/module.js:12:17)
    at Object.<anonymous> (/home/jenkins/workspace/ds/loopback-connector-oracle~master/node_modules/loopback-datasource-juggler/test/common.batch.js:10:1)
    at Module._compile (module.js:409:26)
    at Object.Module._extensions..js (module.js:416:10)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
    at Module.require (module.js:353:17)
    at require (internal/module.js:12:17)
    at Object.<anonymous> (/home/jenkins/workspace/ds/loopback-connector-oracle~master/test/oracle.test.js:10:1)
    at Module._compile (module.js:409:26)
    at Object.Module._extensions..js (module.js:416:10)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
    at Module.require (module.js:353:17)
    at require (internal/module.js:12:17)
    at /home/jenkins/workspace/ds/loopback-connector-oracle~master/node_modules/mocha/lib/mocha.js:220:27
    at Array.forEach (native)
    at Mocha.loadFiles (/home/jenkins/workspace/ds/loopback-connector-oracle~master/node_modules/mocha/lib/mocha.js:217:14)
    at Mocha.run (/home/jenkins/workspace/ds/loopback-connector-oracle~master/node_modules/mocha/lib/mocha.js:469:10)
    at Object.<anonymous> (/home/jenkins/workspace/ds/loopback-connector-oracle~master/node_modules/mocha/bin/_mocha:404:18)
    at Module._compile (module.js:409:26)
    at Object.Module._extensions..js (module.js:416:10)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
    at Function.Module.runMain (module.js:441:10)
    at startup (node.js:139:18)
    at node.js:990:3
npm ERR! Test failed.  See above for more details.

CI link: https://cis-jenkins.swg-devops.com/job/ds/job/loopback-connector-oracle~master/211/console

Missing utf-8 support

It may be related to the strong-oracle module as there seems to be no charset option.

Windows: repeated install screws up PATH

Installing the connector prepends an entry to my PATH every time.
At some point the path becomes too long and old entries start dropping off.
I think it's not needed to modify the path at all - but at least don't add the same location many times?

To show off some of my histrionic personality disorder, I've pasted below an excerpt of - what I just discovered to be - my user %PATH%:

D:\node_modules\sls-sample-app\node_modules\loopback-connector-oracle\node_modules\instantclient\vc11;D:\node_modules\sls-sample-app\node_modules\loopback-connector-oracle\node_modules\instantclient;D:\test\node_modules\slc\node_modules\sls-sample-app\node_modules\loopback-connector-oracle\node_modules\instantclient\vc11;D:\test\node_modules\slc\node_modules\sls-sample-app\node_modules\loopback-connector-oracle\node_modules\instantclient;D:\a\sls-sample-app\node_modules\loopback-connector-oracle\node_modules\instantclient\vc11;D:\a\sls-sample-app\node_modules\loopback-connector-oracle\node_modules\instantclient;D:\test\node_modules\slc\node_modules\sls-sample-app\node_modules\loopback-connector-oracle\node_modules\instantclient;D:\test\node_modules\slc\node_modules\sls-sample-app\node_modules\loopback-connector-oracle\node_modules\instantclient;D:\test\node_modules\slc\node_modules\sls-sample-app\node_modules\loopback-connector-oracle\node_modules\instantclient;D:\test\node_modules\slc\node_modules\sls-sample-app\node_modules\loopback-connector-oracle\node_modules\instantclient;D:\test\node_modules\slc\node_modules\sls-sample-app\node_modules\loopback-connector-oracle\node_modules\instantclient;D:\test\node_modules\slc\node_modules\sls-sample-app\node_modules\loopback-connector-oracle\node_modules\instantclient;D:\test\node_modules\slc\node_modules\sls-sample-app\node_modules\loopback-connector-oracle\node_modules\instantclient;D:\test\node_modules\slc\node_modules\sls-sample-app\node_modules\loopback-connector-oracle\node_modules\instantclient;D:\test\node_modules\slc\node_modules\sls-sample-app\node_modules\loopback-connector-oracle\node_modules\instantclient;D:\test\node_modules\slc\node_modules\sls-sample-app\node_modules\loopback-connector-oracle\node_modules\instantclient;D:\test\node_modules\slc\node_modules\sls-sample-app\node_modules\loopback-connector-oracle\node_modules\instantclient;D:\test\node_modules\slc\node_modules\sls-sample-app\node_modules\loopback-connector-oracle\node_modules\instantclient;D:\test\node_modules\slc\node_modules\sls-sample-app\node_modules\loopback-connector-oracle\node_modules\instantclient;D:\test\node_modules\slc\node_modules\sls-sample-app\node_modules\loopback-connector-oracle\node_modules\instantclient;D:\test\node_modules\slc\node_modules\sls-sample-app\node_modules\loopback-connector-oracle\node_modules\instantclient;D:\test\node_modules\slc\node_modules\sls-sample-app\node_modules\loopback-connector-oracle\node_modules\instantclient;D:\test\node_modules\slc\node_modules\sls-sample-app\node_modules\loopback-connector-oracle\node_modules\instantclient;D:\test\node_modules\slc\node_modules\sls-sample-app\node_modules\loopback-connector-oracle\node_modules\instantclient;D:\test\node_modules\slc\node_modules\sls-sample-app\node_modules\loopback-connector-oracle\node_modules\instantclient;D:\test\node_modules\slc\node_modules\sls-sample-app\node_modules\loopback-connector-oracle\node_modules\instantclient;D:\test\node_modules\slc\node_modules\sls-sample-app\node_modules\loopback-connector-oracle\node_modules\instantclient;D:\sls-sample-app\node_modules\loopback-connector-oracle\node_modules\instantclient;D:\sls-sample-app\node_modules\loopback-connector-oracle\node_modules\instantclient;D:\sls-sample-app\node_modules\loopback-connector-oracle\node_modules\instantclient;D:\sls-sample-app\node_modules\loopback-connector-oracle\node_modules\instantclient;D:\sls-sample-app\node_modules\loopback-connector-oracle\node_modules\instantclient;D:\sls-sample-app\node_modules\loopback-connector-oracle\node_modules\instantclient;D:\sls-sample-app\node_modules\loopback-connector-oracle\node_modules\instantclient;D:\sls-sample-app\node_modules\loopback-connector-oracle\node_modules\instantclient;D:\sls-sample-app\node_modules\loopback-connector-oracle\node_modules\instantclient;D:\sls-sample-app\node_modules\loopback-connector-oracle\node_modules\instantclient;

maxRows configuration is not being respected

I recently encountered an issue with my unfiltered api calls being limited to 100 records.

I set debug using DEBUG=loopback:connector:*
This showed me that my oracle connector has a property: "maxRows": 100

in my server/datasources.json, I set the maxRows property to 1000; however, my unfiltered api calls are still only returning 100 rows.

What am I missing?

Issues running in Centos 5

I'm having issues starting loopback server with loopback-connector-oracle in Centos 5 32-bit environment. During server start I get error message about loopback connector "oracle" not being installed. During npm install there are no error messages. I am sure that I have sourced ~/strong-oracle.rc and LD_LIBRARY_PATH looks correct.

I have done several clean minimal installations of Centos 5 and Centos 6 with bare minimum to run our loopback server software: gcc, python 2.7 and node v0.12.7. Each time Centos 6 works without any issues and Centos 5 fails to start. I even installed the node-oracledb low level driver and some other modules that require compiling and they seem to work just fine so there should not be anything totally wrong in my dev environment.

My question is: is there something in the loopback-connector-oracle or strong-oracle that maybe requires some system level packages that does not exist / are too old in Centos 5? The error message is so vague, it just states that its not installed when it actually is. However the oracledb driver and oracle database installation itself is supported even in RHEL5 so weird that the wrapper wouldnt be.

How to create an out parameter

I've the doc but coulnd't find out to execute store procedures. Then I find out doing:

        sqlLogin = 'var c NUMBER; var d VARCHAR2(20); execute WEBAPPPORTALPM.pk_portal_n.login(' + loginType + ', ' + username + ', ' + password + ', :c, :d);';
        var result = dataSource.connector.execute(sqlLogin, function(err, response) {
            cb(null, "response: login success");
        });

But here's where I need two out parameters. Is there any way to achive this?

Thanks!

connect error

i get an error.

[Error: ORA-28547: connection to server failed, probable Oracle Net admin error
]
/Users/bitebit/workspace/test/node_modules/loopback-connector-oracle/lib/oracle.js:126
      throw err;
      ^
Error: ORA-28547: connection to server failed, probable Oracle Net admin error
    at Error (native)

datasources.json

  "bigdata": {
    "host": "10.2.69.82",
    "port": 1521,
    "database": "jcywdb",
    "password": "xx",
    "name": "bigdata",
    "user": "xxxx",
    "connector": "oracle"
  }

os mac
loopback 2.22.0
loopback-connector-oracle 2.4.1

Error: The specified procedure could not be found

Getting Error: The specified procedure could not be found by oracle_bindings.node.

Platform Windows Server 2003 R2
Installed node 32 bits node-v0.10.30-x86.msi
Installed Microsoft C++ 2012 Redistributable (x86) - 11.0.61030
Setting environmentvariables InstantClient correct (first vc11)

  • Dependency walker gives no error on oracle_bindings.node
    Only msjava.dll. I also tried with an without the msjava.dll (i've download one at http://www.down-dll.com/index.php?search=msjava.dll). No effect.
  • node -e "console.log(process.arch, require('os').arch())"
    result: ia32 ia32

My package.json:
"name": "ddgMonitor",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node app.js"
},
"dependencies": {
"express": "3.4.8",
"ejs": "0.8.5",
"loopback-connector-oracle": "1.1.5",
"nodemailer" : "0.7.0",
"node-windows" : "0.1.5",
"pg" : "2.11.1",
"soap" : "0.4.7",
"socket.io" : "0.9.16"
}
}

Error:
module.js:356
Module._extensions[extension](this, filename);
^
Error: The specified procedure could not be found.
D:\Beheer\ddg\node_modules\loopback-connector-oracle\node_modules\oracle\build\Release\oracle_bindings.node
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object. (D:\Beheer\ddg\node_modules\loopback-connector-oracle\node_modules\oracle\lib\oracle.js:2:16)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)

module.js:356
Module._extensions[extension](this, filename);
^
Error: The specified procedure could not be found.
D:\Beheer\ddg\node_modules\loopback-connector-oracle\node_modules\oracle\build\Release\oracle_bindings.node
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object. (D:\Beheer\ddg\node_modules\loopback-connector-oracle\node_modules\oracle\lib\oracle.js:2:16)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)

I've tried everything for 3 days now. Please help!

With kind regards,
Henk

Improve installation experience

Find better ways how to configure the path to instant client dynamic library, so that we don't have to mess with ENV variables.

Fail to loopback-connector-oracle on Windows 10

C:\Users\yuzhou\Documents\nodejs\test1>npm install --save loopback-connector-ora
cle
npm WARN package.json [email protected] No README data
npm WARN deprecated [email protected]: graceful-fs version 3 and before will fai
l on newer node releases. Please update to graceful-fs@^4.0.0 as soon as possible.

[email protected] install C:\Users\yuzhou\Documents\nodejs\test1
\node_modules\loopback-connector-oracle\node_modules\loopback-oracle-installer
node pkginstall.js

Downloading/Extracting http://7e9918db41dd01dbf98e-ec15952f71452bc0809d79c86f575
1b6.r22.cf1.rackcdn.com/loopback-oracle-Windows-x64-abi46-1.8.0.tar.gz
HTTP proxy: http://www-proxy.us.oracle.com:80/
[Error: Prebuilt tarball not found for your node version and platform: http://7e
9918db41dd01dbf98e-ec15952f71452bc0809d79c86f5751b6.r22.cf1.rackcdn.com/loopback
-oracle-Windows-x64-abi46-1.8.0.tar.gz]
npm ERR! Windows_NT 6.3.9600
npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs
node_modules\npm\bin\npm-cli.js" "install" "--save" "loopback-connector-oracl
e"
npm ERR! node v4.4.0
npm ERR! npm v2.14.20
npm ERR! code ELIFECYCLE

npm ERR! [email protected] install: node pkginstall.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script 'node pkgi
nstall.js'.
npm ERR! This is most likely a problem with the loopback-oracle-installer packag
e,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node pkginstall.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs loopback-oracle-installer
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!
npm ERR! npm owner ls loopback-oracle-installer
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! C:\Users\yuzhou\Documents\nodejs\test1\npm-debug.log

open source this connector

Just curious what the plan was for switching to using node-oracledb as the driver and whether there are any plans for open sourcing this connector? Paying a couple hundred dollars monthly just to be able to use this connector seems crazy (at least for a small business) and in my opinion will drive prospective users (such as myself) away from using loopback.

If it were open sourced, I think eventually, after becoming more dependent on loopback, some of these same users would be more willing to pay for a monthly fee.

Oracle connector not found even though it is installed - windows server

I have exactly the same issue here as issue #27 with Windows Server 2012.
Node version:
10.38 (64 bit)

In path i have the "\node_modules\instantclient\vc11" -folder and by looking at the content of the folders created i can see that the files are there. Still the end result when trying to "slc run" with having "oracle" as datasource i end up in same situation as was presented in the first message of this issue:
"WARNING: LoopBack connector "oracle" is not installed as any of the following modules."

Same error appears also when trying with arc.

I have installed visual studio express 2013 for desktop. I do not have python installed. Is that ok?

I can run "slc run" successfully if there is no "oracle" listed in the datasources.json. I have installed node and loopback with oracle drivers earlier in OS X with no issues. Looking at this issue with windows adding oracle db support to loopback seems to be causing issues not only for me, but others as well. I received no error messages when i ran "npm install loopback-connector-oracle --save", so troubleshooting this is impossible for me. Can you help me? I created this new issue as #27 was marked as closed.

Installation process: putting strong-oracle.rc in $HOME is a bad idea

Hi, I just installed loopback-connector-oracle and saw the following message:

"strong-oracle.rc" has been created in $HOME. Please manually add the
following to your ".bash_profile":

  source /Users/m01/strong-oracle.rc

If you do not use bash as your default shell, please remember to set
$DYLD_LIBRARY_PATH prior to using node:

  export DYLD_LIBRARY_PATH=":/Users/m01/code/lb-loopback-api/node_modules/loopback-connector-oracle/node_modules/instantclient"

Shame on you! This is a bad, bad, bad idea. You're cluttering the home folder for all the developers, plus you suggest to add a project-specific location to a global config, which will beak other projects when I remove this one and will make me angry when I want different projects use different versions of this library. Please don't do this.

cannot install connector

$ npm install loopback-connector-oracle --save

npm WARN deprecated [email protected]: graceful-fs version 3 and before will fail on newer node releases. Please update to graceful-fs@^4.0.0 as soon as possible.
npm WARN [email protected] requires a peer of kerberos@~0.0 but none was installed.
npm WARN [email protected] No license field.

$ node .

WARNING: LoopBack connector "oracle" is not installed as any of the following modules:

Incorrect handling of leap date.

Models in my oracle datasource have date columns and some data rows have date set to 2016-02-29, which is a leap day. For these specific rows loopback built-in REST API endpoints return 2016-03-01 date. Also doing raw sql queries with datasource.connector.query return 2016-03-01 dates for those rows. It seems that leap days are not handled correctly when raw data is transformed into js object?

Doing queries to the database with any other tools (e.g sqlplus, oracle sql developer ...) returns correct date so the data seems to be correct.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.