2013-04-15 19:36:37 +00:00
|
|
|
/**
|
|
|
|
* Expose `OracleConnection`.
|
|
|
|
*/
|
|
|
|
|
|
|
|
module.exports = OracleConnection;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Module dependencies.
|
|
|
|
*/
|
|
|
|
|
2013-04-15 20:11:33 +00:00
|
|
|
var Connection = require('connection')
|
|
|
|
, debug = require('debug')('oracle-connection')
|
2013-04-15 19:36:37 +00:00
|
|
|
, 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);
|
2013-04-15 19:36:37 +00:00
|
|
|
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');
|
2013-04-15 19:36:37 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 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'}
|
|
|
|
};
|