51 lines
999 B
JavaScript
51 lines
999 B
JavaScript
/**
|
|
* Expose `OracleDataSource`.
|
|
*/
|
|
|
|
module.exports = OracleDataSource;
|
|
|
|
/**
|
|
* Module dependencies.
|
|
*/
|
|
|
|
var DataSource = require('data-source')
|
|
, debug = require('debug')('oracle-data-source')
|
|
, util = require('util')
|
|
, inherits = util.inherits
|
|
, assert = require('assert');
|
|
|
|
/**
|
|
* Create a new `OracleDataSource` with the given `options`.
|
|
*
|
|
* @param {Object} options
|
|
* @return {DataSource}
|
|
*/
|
|
|
|
function OracleDataSource(options) {
|
|
DataSource.apply(this, arguments);
|
|
debug('created with options', options);
|
|
}
|
|
|
|
/**
|
|
* Inherit from `AsteroidModule`.
|
|
*/
|
|
|
|
inherits(OracleDataSource, DataSource);
|
|
|
|
/**
|
|
* Define options.
|
|
*/
|
|
|
|
OracleDataSource.options = {
|
|
'database': {type: 'string', required: true},
|
|
'host': {type: 'string', required: true},
|
|
'port': {type: 'number', min: 10, max: 99999},
|
|
'username': {type: 'string'},
|
|
'password': {type: 'string'}
|
|
};
|
|
|
|
/**
|
|
* Provide the oracle jugglingdb adapter
|
|
*/
|
|
|
|
OracleDataSource.prototype.adapter = require('jugglingdb-oracle'); |