loopback/node_modules/connections/oracle-connection/lib/connection.js

44 lines
923 B
JavaScript
Raw Normal View History

/**
* Expose `OracleConnection`.
*/
module.exports = OracleConnection;
/**
* Module dependencies.
*/
var Connection = require('asteroid-module')
, debug = require('debug')('connection')
, util = require('util')
, inherits = util.inherits
, assert = require('assert');
/**
* Create a new `OracleConnection` with the given `options`.
*
* @param {Object} options
* @return {Connection}
*/
function OracleConnection(options) {
AsteroidModule.apply(this, arguments);
this.options = options;
debug('created with options', options);
}
/**
* Inherit from `AsteroidModule`.
*/
inherits(OracleConnection, Connection);
/**
* Define options.
*/
OracleConnection.defineOption('hostname', 'string', {required: true});
OracleConnection.defineOption('port', 'number', {min: 10, max: 99999});
OracleConnection.defineOption('username', 'string');
OracleConnection.defineOption('password', 'string');