不要怂,就是干,撸起袖子干!

Commit 27576f8a by Sascha Depold

preps for multi database support

1 parent 07273911
var ConnectorManager = module.exports = function() {
throw new Error('Define the constructor!')
}
ConnectorManager.prototype.query = function(sql, callee, options) {
throw new Error('Define the query method!')
}
ConnectorManager.prototype.connect = function() {
throw new Error('Define the connect method!')
}
ConnectorManager.prototype.disconnect = function() {
throw new Error('Define the disconnect method!')
}
ConnectorManager.prototype.reconnect = function() {
this.disconnect()
this.connect()
}
var Query = require("./query") var Query = require("../../query")
, Utils = require("../../utils")
, without = function(arr, elem) { return arr.filter(function(e) { return e != elem }) } , without = function(arr, elem) { return arr.filter(function(e) { return e != elem }) }
var ConnectorManager = module.exports = function(config) { var ConnectorManager = module.exports = function(config) {
...@@ -9,6 +10,7 @@ var ConnectorManager = module.exports = function(config) { ...@@ -9,6 +10,7 @@ var ConnectorManager = module.exports = function(config) {
this.activeQueue = [] this.activeQueue = []
this.maxConcurrentQueries = (this.config.maxConcurrentQueries || 50) this.maxConcurrentQueries = (this.config.maxConcurrentQueries || 50)
} }
Utils._.extend(ConnectorManager.prototype, require("../connector-manager").prototype)
ConnectorManager.prototype.query = function(sql, callee, options) { ConnectorManager.prototype.query = function(sql, callee, options) {
if(!this.isConnected) this.connect() if(!this.isConnected) this.connect()
......
var Utils = require("../../utils")
var ConnectorManager = module.exports = function() {
}
Utils._.extend(ConnectorManager.prototype, require("../connector-manager").prototype)
ConnectorManager.prototype.connect = function() {
return ''
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!