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

49 lines
957 B
JavaScript
Raw Normal View History

/**
* Expose `OracleConnection`.
*/
module.exports = OracleConnection;
/**
* Module dependencies.
*/
2013-04-15 20:11:33 +00:00
var Connection = require('connection')
, debug = require('debug')('oracle-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) {
2013-04-15 20:11:33 +00:00
Connection.apply(this, arguments);
this.options = options;
debug('created with options', options);
2013-04-15 20:11:33 +00:00
// provide the oracle jugglingdb adapter
this.adapter = require('jugglingdb-oracle');
}
/**
* Inherit from `AsteroidModule`.
*/
inherits(OracleConnection, Connection);
/**
* Define options.
*/
2013-04-15 20:11:33 +00:00
OracleConnection.options = {
'hostname': {type: 'string', required: true},
'port': {type: 'number', min: 10, max: 99999},
'username': {type: 'string'},
'password': {type: 'string'}
};