sqb-connect-oracle

3.2.2 • Public • Published

SQB-connect-oracle

NPM Version NPM Downloads Dependencies DevDependencies PeerDependencies

Oracle connection adapter for SQB.

Configuring

Authentication options

Internal Authentication

Applications using internal authentication stores credentials manually and passes user and password properties in configuration object.

sqb.use('sqb-connect-oracle');
const pool = sqb.pool({
  dialect: 'oracle',
  user: 'anyuser',
  password: 'anypassword',
  ....
})

External Authentication

External Authentication allows applications to use an external password store (such as Oracle Wallet), the Secure Socket Layer (SSL), or the operating system to validate user access. One of the benefits is that database credentials do not need to be hard coded in the application.

To use external authentication, set the externalAuth property to true. (Default false)

sqb.use('sqb-connect-oracle');
const pool = sqb.pool({
  dialect: 'oracle',
  externalAuth: true
  ....
})

Connection configuration options

Configure using connection parameters

sqb.use('sqb-connect-oracle');
const pool = sqb.pool({
  dialect: 'oracle',
  ** Authentication options here 
  host: 'localhost',
  port: 1521,
  database: 'SALES'
})
  • host: Hostname to connect to
  • port: Port to connect to (default: 1521)
  • database: Database (service name) to connect to (Optional)
  • serverType: Type of server (Optional)
  • instanceName: Instance name (Optional)

Configure using easy connection syntax

An Easy Connect string is often the simplest to use. With Oracle Database 12c the syntax is:

[//]host[:port][/database][:serverType][/instanceName]

sqb.use('sqb-connect-oracle');
const pool = sqb.pool({
  dialect: 'oracle',
  ** Authentication options here 
  connectString: 'localhost:1521/SALES'
})

Configure using Net service name

A Net Service Name, such as sales in the example below, can be used to connect:

sqb.use('sqb-connect-oracle');
const pool = sqb.pool({
  dialect: 'oracle',
  ** Authentication options here 
  connectString: 'sales'
})

This could be defined in a directory server, or in a local tnsnames.ora file, for example:

sales =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = mymachine.example.com)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = orcl)
    )
  )

Configure using full connection strings

sqb.use('sqb-connect-oracle');
const pool = sqb.pool({
  dialect: 'oracle',
  ** Authentication options here 
  connectString: '(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=mymachine.example.com)(PORT=1521))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)))'
})

Additional parameters

sqb.use('sqb-connect-oracle');
const pool = sqb.pool({
  dialect: 'oracle',
  ** Connection options here 
  schema: 'otherschema'
})
  • schema: Sets default schema for session

Node Compatibility

  • node (LTE only) >= 6.x;

License

MIT

Package Sidebar

Install

npm i sqb-connect-oracle

Weekly Downloads

0

Version

3.2.2

License

MIT

Unpacked Size

23.8 kB

Total Files

8

Last publish

Collaborators

  • erayhanoglu