Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// LoopBack uses GeoPoint instead.
// The Point type can be removed at some point in the future.
defineType(function Point() {
});
}
/**
* @constructor
* Constructor for MySQL connector
* @param {Object} client The node-mysql client object
*/
function MySQL(settings) {
SqlConnector.call(this, 'mysql', settings);
}
require('util').inherits(MySQL, SqlConnector);
MySQL.prototype.connect = function(callback) {
var self = this;
var options = generateOptions(this.settings);
var s = self.settings || {};
if (this.client) {
if (callback) {
process.nextTick(function() {
callback(null, self.client);
});
}
} else {
this.client = mysql.createPool(options);
this.client.getConnection(function(err, connection) {
var conn = connection;
* @prop {String} database The database name (TNS listener name)
* @prop {Boolean|Number} debug If true, print debug messages. If Number, ?
* @class
*/
function Oracle(oracle, settings) {
this.constructor.super_.call(this, 'oracle', settings);
this.driver = oracle;
this.pool = null;
this.parallelLimit = settings.maxConn || settings.poolMax || 16;
if (settings.debug || debug.enabled) {
debug('Settings: %j', settings);
}
}
// Inherit from loopback-datasource-juggler BaseSQL
require('util').inherits(Oracle, SqlConnector);
Oracle.prototype.debug = function() {
if (this.settings.debug || debug.enabled) {
debug.apply(null, arguments);
}
};
/**
* Connect to Oracle
* @param {Function} [callback] The callback after the connection is established
*/
Oracle.prototype.connect = function(callback) {
var self = this;
if (this.pool) {
if (callback) {
process.nextTick(function() {
}
/**
* @constructor
* Constructor for Cassandra connector
* @param {Object} client The node-mysql client object
*/
function Cassandra(dataSource, settings) {
this.dataSource = dataSource;
dataSource.setMaxListeners(Infinity);
SqlConnector.call(this, 'cassandra', settings);
}
require('util').inherits(Cassandra, SqlConnector);
Cassandra.prototype.connect = function(callback) {
var self = this;
var options = generateOptions(this.settings);
var s = self.settings || {};
if (this.client) {
if (callback) {
process.nextTick(function() {
callback(null, self.client);
});
}
} else {
this.client = new cassandra.Client(options);
this.client.connect(function(err) {
var conn = self.client.controlConnection.connection;